






"""simple docstring"""



from unittest import TestCase

from datasets import Dataset
from minhash_deduplication import deduplicate_dataset, make_duplicate_clusters



def 						lowercase    (				):
		lowercase_ : Union[str, Any]							       =   {
		    '''repo_name''': ['''test_repo1''', '''test_repo2''', '''test_repo3'''],
		    '''path''': ['''test_1.py''', '''test_2.py''', '''unit_test.py'''],
		    '''content''': ['''a ''' * 2_0, '''a ''' * 3_0, '''b ''' * 7],
		}
		lowercase_ : List[Any]							       =   Dataset.from_dict(__snake_case	)
		return dataset






class 					_UpperCAmelCase       ( _A							):




					def   A  (				self     :						Any   )  ->  Optional[Any]:
							lowercase_ : Optional[Any]							       =   get_dataset()
							lowercase_ : int							       =   make_duplicate_clusters(A    ,						0.85   )
							self.assertEqual(len(duplicate_clusters[0]   )    ,						2   )






					def   A  (				self     :						Optional[int]   )  ->  int:
							lowercase_ : List[Any]							       =   get_dataset()
							lowercase_       ,					lowercase_ : Optional[Any]							       =   deduplicate_dataset(A   )
							self.assertEqual(len(A   )    ,						2   )
							print(A   )
							self.assertEqual(duplicate_clusters[0][0]['''copies''']    ,						2   )
							self.assertEqual(duplicate_clusters[0][0]['''is_extreme''']    ,						A   )











"""simple docstring"""



def 						lowercase    (				__snake_case				: int	):
		if not isinstance(__snake_case		,					__snake_case	):
				raise ValueError('''Input must be an integer'''	)
		if input_num <= 0:
				raise ValueError('''Input must be positive'''	)
		return sum(
		    divisor for divisor in range(1		,					input_num // 2 + 1	) if input_num % divisor == 0	)


if __name__ == "__main__":
						import doctest

						doctest.testmod()



