
'''simple docstring'''




import pytest


lowercase			:				Tuple    		=			'__dummy_dataset1__'

lowercase			:				int    		=			'\nimport json\nimport os\n\nimport datasets\n\n\nREPO_URL = "https://huggingface.co/datasets/albertvillanova/tests-raw-jsonl/resolve/main/"\nURLS = {"train": REPO_URL + "wikiann-bn-train.jsonl", "validation": REPO_URL + "wikiann-bn-validation.jsonl"}\n\n\nclass __DummyDataset1__(datasets.GeneratorBasedBuilder):\n\n    def _info(self):\n        features = datasets.Features(\n            {\n                "tokens": datasets.Sequence(datasets.Value("string")),\n                "ner_tags": datasets.Sequence(\n                    datasets.features.ClassLabel(\n                        names=[\n                            "O",\n                            "B-PER",\n                            "I-PER",\n                            "B-ORG",\n                            "I-ORG",\n                            "B-LOC",\n                            "I-LOC",\n                        ]\n                    )\n                ),\n                "langs": datasets.Sequence(datasets.Value("string")),\n                "spans": datasets.Sequence(datasets.Value("string")),\n            }\n        )\n        return datasets.DatasetInfo(features=features)\n\n    def _split_generators(self, dl_manager):\n        dl_path = dl_manager.download(URLS)\n        return [\n            datasets.SplitGenerator(datasets.Split.TRAIN, gen_kwargs={"filepath": dl_path["train"]}),\n            datasets.SplitGenerator(datasets.Split.VALIDATION, gen_kwargs={"filepath": dl_path["validation"]}),\n        ]\n\n    def _generate_examples(self, filepath):\n        with open(filepath, "r", encoding="utf-8") as f:\n            for i, line in enumerate(f):\n                yield i, json.loads(line)\n'







@pytest.fixture
def 		lowerCAmelCase_				(   ):




    '''simple docstring'''



    return DATASET_LOADING_SCRIPT_NAME







@pytest.fixture
def 		lowerCAmelCase_				(   ):




    '''simple docstring'''



    return DATASET_LOADING_SCRIPT_CODE







@pytest.fixture
def 		lowerCAmelCase_				(   snake_case__		,				snake_case__		,				snake_case__						):




    '''simple docstring'''



    A       :   Optional[int]					=						dataset_loading_script_name
    A       :   Any					=						tmp_path / '''datasets''' / script_name
    script_dir.mkdir(parents=a__						)
    A       :   Dict					=						script_dir / F'{script_name}.py'
    with open(a__		,				'''w'''						) as f:
        f.write(a__						)
    return str(a__						)







'''simple docstring'''



# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import argparse

from ...utils.dataclasses import (
    ComputeEnvironment,
    DistributedType,
    DynamoBackend,
    PrecisionType,
    SageMakerDistributedType,
)
from ..menu import BulletMenu


UpperCAmelCase :       Any			   =     [
    'EAGER',
    'AOT_EAGER',
    'INDUCTOR',
    'NVFUSER',
    'AOT_NVFUSER',
    'AOT_CUDAGRAPHS',
    'OFI',
    'FX2TRT',
    'ONNXRT',
    'IPEX',
]







def    a__       (  a__      ,    a__=None      ,    a__=None      ,    a__=None						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE     =      True
     while ask_again:
          __SCREAMING_SNAKE_CASE     =      input(a__						)
          try:
               if default is not None and len(a__						) == 0:
                    return default
               return convert_value(a__						) if convert_value is not None else result
          except Exception:
               if error_message is not None:
                    print(a__						)







def    a__       (  a__      ,    a__=[]      ,    a__=None      ,    a__=0						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE     =      BulletMenu(a__      ,    a__						)
     __SCREAMING_SNAKE_CASE     =      menu.run(default_choice=a__						)
     return convert_value(a__						) if convert_value is not None else result







def    a__       (  a__						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE     =      int(a__						)
     return ComputeEnvironment(["""LOCAL_MACHINE""", """AMAZON_SAGEMAKER"""][value]						)







def    a__       (  a__						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE     =      int(a__						)
     return DistributedType(["""NO""", """MULTI_CPU""", """MULTI_XPU""", """MULTI_GPU""", """MULTI_NPU""", """TPU"""][value]						)







def    a__       (  a__						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE     =      int(a__						)
     return DynamoBackend(DYNAMO_BACKENDS[value]						).value







def    a__       (  a__						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE     =      int(a__						)
     return PrecisionType(["""no""", """fp16""", """bf16""", """fp8"""][value]						)







def    a__       (  a__						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE     =      int(a__						)
     return SageMakerDistributedType(["""NO""", """DATA_PARALLEL""", """MODEL_PARALLEL"""][value]						)







def    a__       (  a__						):




     """simple docstring"""


     return {"yes": True, "no": False}[value.lower()]







class 						lowerCAmelCase__   (      argparse.RawDescriptionHelpFormatter					):



 """simple docstring"""



 def       UpperCAmelCase__		(		self					:       str					,							__SCREAMING_SNAKE_CASE					:       Optional[Any]					,							__SCREAMING_SNAKE_CASE					:       Dict					,							__SCREAMING_SNAKE_CASE					:       Optional[int]					,							__SCREAMING_SNAKE_CASE					:       List[Any]			)  -> Dict:


      """simple docstring"""




      __SCREAMING_SNAKE_CASE     =      super()._format_usage(__SCREAMING_SNAKE_CASE					,							__SCREAMING_SNAKE_CASE					,							__SCREAMING_SNAKE_CASE					,							__SCREAMING_SNAKE_CASE			)
      __SCREAMING_SNAKE_CASE     =      usage.replace("""<command> [<args>] """					,							""""""			)
      return usage






