



from unittest import TestCase

from datasets import Dataset
from minhash_deduplication import deduplicate_dataset, make_duplicate_clusters

def   lowerCAmelCase__						(							):
				"""simple docstring"""







				__a       =		{
				    """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],
				}
				__a       =		Dataset.from_dict(snake_case__    )
				return dataset






class    SCREAMING_SNAKE_CASE			(							_lowercase					):





							def 						UpperCamelCase_					(   self		:		List[Any]	):

											'''simple docstring'''
											__a       =		get_dataset()
											__a       =		make_duplicate_clusters(A_      ,				0.85	)
											self.assertEqual(len(duplicate_clusters[0]	)      ,				2	)







							def 						UpperCamelCase_					(   self		:		str	):

											'''simple docstring'''
											__a       =		get_dataset()
											__a     ,					__a       =		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_	)





def   lowerCAmelCase__						(							_SCREAMING_SNAKE_CASE       :			int = 3				,     _SCREAMING_SNAKE_CASE       :			int = 7				,     _SCREAMING_SNAKE_CASE       :			int = 100_0000    ):
				"""simple docstring"""







				__a       =		0
				__a       =		1

				for current_denominator in range(1				,     limit + 1    ):
								__a       =		current_denominator * numerator // denominator
								if current_denominator % denominator == 0:
												current_numerator -= 1
								if current_numerator * max_denominator > current_denominator * max_numerator:
												__a       =		current_numerator
												__a       =		current_denominator
				return max_numerator


if __name__ == "__main__":
						print(solution(numerator=3, denominator=7, limit=100_0000))
