

"""simple docstring"""





from torch import nn




class  _lowerCAmelCase  (     nn.Module       ):







 """simple docstring"""







 def __init__(      self							:      int, UpperCAmelCase__							:      Optional[Any], UpperCAmelCase__							:      Any     ):
    super().__init__()
    __lowercase								=						class_size
    __lowercase								=						embed_size
    # self.mlp1 = nn.Linear(embed_size, embed_size)
    # self.mlp2 = (nn.Linear(embed_size, class_size))
    __lowercase								=						nn.Linear(UpperCAmelCase__, UpperCAmelCase__     )



 def  _lowercase			(      self							:      Tuple, UpperCAmelCase__							:      Dict     ):
    # hidden_state = nn.functional.relu(self.mlp1(hidden_state))
    # hidden_state = self.mlp2(hidden_state)
    __lowercase								=						self.mlp(UpperCAmelCase__     )
    return logits







"""simple docstring"""





from unittest import TestCase

from datasets import Dataset
from minhash_deduplication import deduplicate_dataset, make_duplicate_clusters




def   _A  (  )     ->						Dict:
   '''simple docstring'''


   __lowercase								=						{
       "repo_name": ["test_repo1", "test_repo2", "test_repo3"],
       "path": ["test_1.py", "test_2.py", "unit_test.py"],
       "content": ["a " * 20, "a " * 30, "b " * 7],
   }
   __lowercase								=						Dataset.from_dict(UpperCamelCase_)
   return dataset




class  _lowerCAmelCase  (     lowercase       ):







 """simple docstring"""







 def  _lowercase			(      self							:      int     ):
    __lowercase								=						get_dataset()
    __lowercase								=						make_duplicate_clusters(UpperCAmelCase__, 0.85     )
    self.assertEqual(len(duplicate_clusters[0]     ), 2     )



 def  _lowercase			(      self							:      Any     ):
    __lowercase								=						get_dataset()
    __lowercase		,__lowercase								=						deduplicate_dataset(UpperCAmelCase__     )
    self.assertEqual(len(UpperCAmelCase__     ), 2     )
    print(UpperCAmelCase__     )
    self.assertEqual(duplicate_clusters[0][0]["copies"], 2     )
    self.assertEqual(duplicate_clusters[0][0]["is_extreme"], UpperCAmelCase__     )




