



"""simple docstring"""





from unittest import TestCase

from datasets import Dataset
from minhash_deduplication import deduplicate_dataset, make_duplicate_clusters
def 	__lowerCAmelCase						(		):


						'''simple docstring'''






						snake_case_   : Dict						=			{
						    """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],
						}
						snake_case_   : Union[str, Any]						=			Dataset.from_dict(__UpperCamelCase    )
						return dataset






class    _lowerCAmelCase    (				SCREAMING_SNAKE_CASE__		):





		"""simple docstring"""






		def    UpperCAmelCase__							(					self   ) ->						int:







								'''simple docstring'''

								snake_case_   : List[Any]						=			get_dataset()
								snake_case_   : Optional[Any]						=			make_duplicate_clusters(_lowercase							,    0.85   )
								self.assertEqual(len(duplicate_clusters[0]   )							,    2   )





		def    UpperCAmelCase__							(					self   ) ->						Dict:







								'''simple docstring'''

								snake_case_   : List[Any]						=			get_dataset()
								snake_case_			,		snake_case_   : Union[str, Any]						=			deduplicate_dataset(_lowercase   )
								self.assertEqual(len(_lowercase   )							,    2   )
								print(_lowercase   )
								self.assertEqual(duplicate_clusters[0][0]["""copies"""]							,    2   )
								self.assertEqual(duplicate_clusters[0][0]["""is_extreme"""]							,    _lowercase   )






"""simple docstring"""





def 	__lowerCAmelCase						(		__UpperCamelCase      :			int					, __UpperCamelCase      :			int    ):


						'''simple docstring'''






						snake_case_   : Any						=			1  # To kept the Calculated Value
						# Since C(n, k) = C(n, n-k)
						if k > (n - k):
												snake_case_   : Optional[int]						=			n - k
						# Calculate C(n,k)
						for i in range(__UpperCamelCase    ):
												result *= n - i
												result //= i + 1
						return result
def 	__lowerCAmelCase						(		__UpperCamelCase      :			int    ):


						'''simple docstring'''






						return binomial_coefficient(2 * node_count					, __UpperCamelCase    ) // (node_count + 1)
def 	__lowerCAmelCase						(		__UpperCamelCase      :			int    ):


						'''simple docstring'''






						if n < 0:
												raise ValueError("""factorial() not defined for negative values"""    )
						snake_case_   : Optional[int]						=			1
						for i in range(1					, n + 1    ):
												result *= i
						return result
def 	__lowerCAmelCase						(		__UpperCamelCase      :			int    ):


						'''simple docstring'''






						return catalan_number(__UpperCamelCase    ) * factorial(__UpperCamelCase    )


if __name__ == "__main__":
					__lowerCAmelCase       :					Optional[Any]      					=					int(input('''Enter the number of nodes: ''').strip() or 0)
					if node_count <= 0:
										raise ValueError('''We need some nodes to work with.''')
					print(
					    F'''Given {node_count} nodes, there are {binary_tree_count(node_count)} '''
					    F'''binary trees and {catalan_number(node_count)} binary search trees.'''
					)

