import csv
import json
import os

import datasets


# TODO: Add BibTeX citation
# Find for instance the citation on arxiv or on the dataset repo/website
__lowerCAmelCase    :  List[Any]										= '\\n@InProceedings{huggingface:dataset,\ntitle = {A great new dataset},\nauthor={huggingface, Inc.\n},\nyear={2020}\n}\n'

# TODO: Add description of the dataset here
# You can copy an official description
__lowerCAmelCase    :  Union[str, Any]										= '\\nThis new dataset is designed to solve this great NLP task and is crafted with a lot of care.\n'

# TODO: Add a link to an official homepage for the dataset here
__lowerCAmelCase    :  Dict										= ''

# TODO: Add the licence for the dataset here if you can find it
__lowerCAmelCase    :  int										= ''

# TODO: Add link to the official dataset URLs here
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
__lowerCAmelCase    :  Optional[int]										= {
    'first_domain': 'https://huggingface.co/great-new-dataset-first_domain.zip',
    'second_domain': 'https://huggingface.co/great-new-dataset-second_domain.zip',
}
class 				lowerCamelCase			(							datasets.GeneratorBasedBuilder					):
      __lowerCamelCase							=					datasets.Version('1.1.0'					)

      # This is an example of a dataset with multiple configurations.
      # If you don't want/need to define several sub-sets in your dataset,
      # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.

      # If you need to make complex sub-parts in the datasets with configurable options
      # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
      # BUILDER_CONFIG_CLASS = MyBuilderConfig

      # You will be able to load one or the other configurations in the following list with
      # data = datasets.load_dataset('my_dataset', 'first_domain')
      # data = datasets.load_dataset('my_dataset', 'second_domain')
      __lowerCamelCase							=					[
          datasets.BuilderConfig(name='first_domain'				,     version=__snake_case				,     description='This part of my dataset covers a first domain'					),
          datasets.BuilderConfig(name='second_domain'				,     version=__snake_case				,     description='This part of my dataset covers a second domain'					),
      ]

      __lowerCamelCase							=					'first_domain'  # It's not mandatory to have a default configuration. Just use one if it make sense.






      def 			lowerCAmelCase_   (      self						)     ->				Any:


          '''simple docstring'''







          if self.config.name == "first_domain":  # This is the name of the configuration selected in BUILDER_CONFIGS above
              snake_case:						int         =   datasets.Features(
                  {
                      """sentence""": datasets.Value("""string"""						),
                      """option1""": datasets.Value("""string"""						),
                      """answer""": datasets.Value("""string"""						)
                      # These are the features of your dataset like images, labels ...
                  }						)
          else:  # This is an example to show how to have different features for "first_domain" and "second_domain"
              snake_case:						List[Any]         =   datasets.Features(
                  {
                      """sentence""": datasets.Value("""string"""						),
                      """option2""": datasets.Value("""string"""						),
                      """second_domain_answer""": datasets.Value("""string"""						)
                      # These are the features of your dataset like images, labels ...
                  }						)
          return datasets.DatasetInfo(
              # This is the description that will appear on the datasets page.
              description=_DESCRIPTION  ,		features=__lowerCamelCase  ,		homepage=_HOMEPAGE  ,		license=_LICENSE  ,		citation=_CITATION  ,		)






      def 			lowerCAmelCase_   (      self  ,		__lowerCamelCase						)     ->				Optional[Any]:


          '''simple docstring'''







          snake_case:						Dict         =   _URLS[self.config.name]
          snake_case:						Dict         =   dl_manager.download_and_extract(__lowerCamelCase						)
          return [
              datasets.SplitGenerator(
                  name=datasets.Split.TRAIN  ,		gen_kwargs={
                      """filepath""": os.path.join(__lowerCamelCase  ,		"""train.jsonl"""						),
                      """split""": """train""",
                  }  ,		),
              datasets.SplitGenerator(
                  name=datasets.Split.VALIDATION  ,		gen_kwargs={
                      """filepath""": os.path.join(__lowerCamelCase  ,		"""dev.jsonl"""						),
                      """split""": """dev""",
                  }  ,		),
              datasets.SplitGenerator(
                  name=datasets.Split.TEST  ,		gen_kwargs={
                      """filepath""": os.path.join(__lowerCamelCase  ,		"""test.jsonl"""						),
                      """split""": """test"""
                  }  ,		),
          ]






      def 			lowerCAmelCase_   (      self  ,		__lowerCamelCase  ,		__lowerCamelCase						)     ->				Optional[Any]:


          '''simple docstring'''







          with open(__lowerCamelCase  ,		encoding="""utf-8"""						) as f:
              for key, row in enumerate(__lowerCamelCase						):
                  snake_case:						List[str]         =   json.loads(__lowerCamelCase						)
                  if self.config.name == "first_domain":
                      # Yields examples as (key, example) tuples
                      yield key, {
                          "sentence": data["sentence"],
                          "option1": data["option1"],
                          "answer": "" if split == "test" else data["answer"],
                      }
                  else:
                      yield key, {
                          "sentence": data["sentence"],
                          "option2": data["option2"],
                          "second_domain_answer": "" if split == "test" else data["second_domain_answer"],
                      }



def   a_					(_lowerCAmelCase  :   int       )->				str:
    if not isinstance(_lowerCAmelCase			,	_lowerCAmelCase       ):
        snake_case:						Optional[Any]         =   (
            """operation can not be conducted on a object of type """
            F"{type(_lowerCAmelCase       ).__name__}"
        )
        raise TypeError(_lowerCAmelCase       )
    snake_case:						List[Any]         =   """"""
    for _ in range(0			,	32       ):
        bit_string += str(number % 2       )
        snake_case:						Any         =   number >> 1
    return bit_string

def   a_					(_lowerCAmelCase  :   int       )->				str:
    if number < 0:
        raise ValueError("""the value of input must be positive"""       )
    elif isinstance(_lowerCAmelCase			,	_lowerCAmelCase       ):
        raise TypeError("""Input value must be a 'int' type"""       )
    elif isinstance(_lowerCAmelCase			,	_lowerCAmelCase       ):
        raise TypeError("""'<' not supported between instances of 'str' and 'int'"""       )
    snake_case:						Optional[Any]         =   0
    # iterator over [1 to 32],since we are dealing with 32 bit integer
    for _ in range(1			,	33       ):
        # left shift the bits by unity
        snake_case:						Dict         =   result << 1
        # get the end bit
        snake_case:						Union[str, Any]         =   number % 2
        # right shift the bits by unity
        snake_case:						Union[str, Any]         =   number >> 1
        # add that bit to our ans
        snake_case:						Tuple         =   result | end_bit
    return get_reverse_bit_string(_lowerCAmelCase       )


if __name__ == "__main__":
    import doctest

    doctest.testmod()


