


from unittest import TestCase

from datasets import Dataset
from minhash_deduplication import deduplicate_dataset, make_duplicate_clusters




def 	a_      (    ):
       '''simple docstring'''





       _lowerCamelCase       :		int		={
           '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],
       }
       _lowerCamelCase       :		str		=Dataset.from_dict(SCREAMING_SNAKE_CASE__     )
       return dataset




class A  (   UpperCamelCase_     ):






      def        lowerCamelCase       (					self						:     List[str] )					->						Dict:
             """simple docstring"""




             _lowerCamelCase       :		List[str]		=get_dataset()
             _lowerCamelCase       :		Any		=make_duplicate_clusters(lowercase_			,   0.85 )
             self.assertEqual(len(duplicate_clusters[0] )			,   2 )






      def        lowerCamelCase       (					self						:     int )					->						Optional[int]:
             """simple docstring"""




             _lowerCamelCase       :		Any		=get_dataset()
             _lowerCamelCase	,     _lowerCamelCase       :		Tuple		=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_ )






import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
 import ctypes
 import msvcrt  # noqa




 class A  (   ctypes.Structure     ):
       # _fields is a specific attr expected by ctypes
       UpperCamelCase__							:  List[Any]      =[('size', ctypes.c_int), ('visible', ctypes.c_byte)]




def 	a_      (    ):
       '''simple docstring'''





       if os.name == "nt":
              _lowerCamelCase       :		Optional[Any]		=CursorInfo()
              _lowerCamelCase       :		Dict		=ctypes.windll.kernelaa.GetStdHandle(-11     )
              ctypes.windll.kernelaa.GetConsoleCursorInfo(SCREAMING_SNAKE_CASE__		,			ctypes.byref(SCREAMING_SNAKE_CASE__     )     )
              _lowerCamelCase       :		Any		=False
              ctypes.windll.kernelaa.SetConsoleCursorInfo(SCREAMING_SNAKE_CASE__		,			ctypes.byref(SCREAMING_SNAKE_CASE__     )     )
       elif os.name == "posix":
              sys.stdout.write('\033[?25l'     )
              sys.stdout.flush()




def 	a_      (    ):
       '''simple docstring'''





       if os.name == "nt":
              _lowerCamelCase       :		Any		=CursorInfo()
              _lowerCamelCase       :		Optional[Any]		=ctypes.windll.kernelaa.GetStdHandle(-11     )
              ctypes.windll.kernelaa.GetConsoleCursorInfo(SCREAMING_SNAKE_CASE__		,			ctypes.byref(SCREAMING_SNAKE_CASE__     )     )
              _lowerCamelCase       :		Union[str, Any]		=True
              ctypes.windll.kernelaa.SetConsoleCursorInfo(SCREAMING_SNAKE_CASE__		,			ctypes.byref(SCREAMING_SNAKE_CASE__     )     )
       elif os.name == "posix":
              sys.stdout.write('\033[?25h'     )
              sys.stdout.flush()




@contextmanager
def 	a_      (    ):
       '''simple docstring'''





       try:
              hide_cursor()
              yield
       finally:
              show_cursor()


