






"""simple docstring"""
import timeit

import numpy as np

import datasets
from datasets.arrow_writer import ArrowWriter
from datasets.features.features import _ArrayXD


def 							A						(				__snake_case: str  )    ->		Optional[Any]:

       """simple docstring"""





       def wrapper(*__snake_case: Dict ,     **__snake_case: Optional[Any]  ):
              __magic_name__      				=    timeit.default_timer()
              __magic_name__      				=    func(*lowerCAmelCase_ ,     **lowerCAmelCase_  )
              __magic_name__      				=    timeit.default_timer() - starttime
              return delta

       __magic_name__      				=    func.__name__

       return wrapper


def 							A						(				__snake_case: dict ,     __snake_case: Any=1_0_0 ,     __snake_case: List[Any]=None  )    ->		str:

       """simple docstring"""





       __magic_name__      				=    []
       __magic_name__      				=    seq_shapes or {}
       for i in range(lowerCAmelCase_  ):
              __magic_name__      				=    {}
              for col_id, (k, v) in enumerate(features.items()  ):
                     if isinstance(lowerCAmelCase_ ,     _ArrayXD  ):
                            __magic_name__      				=    np.random.rand(*v.shape  ).astype(v.dtype  )
                     elif isinstance(lowerCAmelCase_ ,     datasets.Value  ):
                            if v.dtype == "string":
                                   __magic_name__      				=    'The small grey turtle was surprisingly fast when challenged.'
                            else:
                                   __magic_name__      				=    np.random.randint(1_0 ,     size=1  ).astype(v.dtype  ).item()
                     elif isinstance(lowerCAmelCase_ ,     datasets.Sequence  ):
                            while isinstance(lowerCAmelCase_ ,     datasets.Sequence  ):
                                   __magic_name__      				=    v.feature
                            __magic_name__      				=    seq_shapes[k]
                            __magic_name__      				=    np.random.rand(*lowerCAmelCase_  ).astype(v.dtype  )
                     __magic_name__      				=    data

              dummy_data.append((i, example)  )

       return dummy_data






def 							A						(				__snake_case: Union[str, Any] ,     __snake_case: str ,     __snake_case: List[Any]=1_0_0 ,     __snake_case: Dict=None  )    ->		List[str]:

       """simple docstring"""





       __magic_name__      				=    generate_examples(lowerCAmelCase_ ,     num_examples=lowerCAmelCase_ ,     seq_shapes=lowerCAmelCase_  )

       with ArrowWriter(features=lowerCAmelCase_ ,     path=lowerCAmelCase_  ) as writer:
              for key, record in dummy_data:
                     __magic_name__      				=    features.encode_example(lowerCAmelCase_  )
                     writer.write(lowerCAmelCase_  )

              __magic_name__				,  __magic_name__      				=    writer.finalize()

       if not num_final_examples == num_examples:
              raise ValueError(
                  F"""Error writing the dataset, wrote {num_final_examples} examples but should have written {num_examples}."""  )

       __magic_name__      				=    datasets.Dataset.from_file(filename=lowerCAmelCase_ ,     info=datasets.DatasetInfo(features=lowerCAmelCase_  )  )

       return dataset



def       _lowerCAmelCase    (				lowerCAmelCase_				:int		,    lowerCAmelCase_				:int				)->int:
   '''simple docstring'''






   return int((input_a, input_a).count(0				) == 0				)



def       _lowerCAmelCase    (				)->None:
   '''simple docstring'''






   assert and_gate(0		,    0				) == 0
   assert and_gate(0		,    1				) == 0
   assert and_gate(1		,    0				) == 0
   assert and_gate(1		,    1				) == 1


if __name__ == "__main__":
   test_and_gate()
   print(and_gate(1, 0))
   print(and_gate(0, 0))
   print(and_gate(0, 1))
   print(and_gate(1, 1))




