"""simple docstring"""







def 	a__   (		UpperCAmelCase__							:      float      )->						Union[str, Any]:
						return -num if num < 0 else num


def 	a__   (		UpperCAmelCase__							:      list[int]      )->						Any:





						if len(lowerCamelCase_      ) == 0:
												raise ValueError("""abs_min() arg is an empty sequence"""      )
						UpperCAmelCase__       						=		x[0]
						for i in x:
												if abs_val(lowerCamelCase_      ) < abs_val(lowerCamelCase_      ):
																		UpperCAmelCase__       						=		i
						return j


def 	a__   (		UpperCAmelCase__							:      list[int]      )->						Any:





						if len(lowerCamelCase_      ) == 0:
												raise ValueError("""abs_max() arg is an empty sequence"""      )
						UpperCAmelCase__       						=		x[0]
						for i in x:
												if abs(lowerCamelCase_      ) > abs(lowerCamelCase_      ):
																		UpperCAmelCase__       						=		i
						return j


def 	a__   (		UpperCAmelCase__							:      list[int]      )->						Union[str, Any]:





						if len(lowerCamelCase_      ) == 0:
												raise ValueError("""abs_max_sort() arg is an empty sequence"""      )
						return sorted(lowerCamelCase_		,      key=lowerCamelCase_      )[-1]


def 	a__   (		)->						str:
						assert abs_val(0      ) == 0
						assert abs_val(3_4      ) == 3_4
						assert abs_val(-1_0_0_0_0_0_0_0_0_0_0_0      ) == 1_0_0_0_0_0_0_0_0_0_0_0

						UpperCAmelCase__       						=		[-3, -1, 2, -1_1]
						assert abs_max(lowerCamelCase_      ) == -1_1
						assert abs_max_sort(lowerCamelCase_      ) == -1_1
						assert abs_min(lowerCamelCase_      ) == -1


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						test_abs_val()
						print(abs_val(-34))  # --> 34


'''simple docstring'''


import re
import tempfile
import unittest
from pathlib import Path

from datasets.utils.metadata import DatasetMetadata


def    _lowerCamelCase       ( lowerCamelCase_   :				str  ):



     """simple docstring"""





     UpperCAmelCase_				:  str  = min(re.search('^ +'      ,	lowerCamelCase_  ).end() if t.startswith(' '  ) else 0 for t in string.splitlines()  )
     return "\n".join([line[indent_level:] for line in string.splitlines() if indent_level < len(lowerCamelCase_  )]  )


snake_case__	:     Dict      =    '''\
---
language:
- zh
- en
task_ids:
- sentiment-classification
---
# Begin of markdown

Some cool dataset card
'''

snake_case__	:     Union[str, Any]      =    '''\
---
---
# Begin of markdown

Some cool dataset card
'''


snake_case__	:     int      =    '''\
# Begin of markdown

Some cool dataset card
'''






class 	__SCREAMING_SNAKE_CASE		(			unittest.TestCase			):







  '''simple docstring'''






  def _UpperCamelCase	(					self		):




       '''simple docstring'''

       with tempfile.TemporaryDirectory() as tmp_dir:
            UpperCAmelCase_				:  Tuple  = Path(snake_case_		) / 'README.md'
            with open(snake_case_ ,						'w+'		) as readme_file:
                 readme_file.write(snake_case_		)
            UpperCAmelCase_				:  Optional[Any]  = DatasetMetadata.from_readme(snake_case_		)
            self.assertDictEqual(snake_case_ ,						{'language': ['zh', 'en'], 'task_ids': ['sentiment-classification']}		)

            with open(snake_case_ ,						'w+'		) as readme_file:
                 readme_file.write(snake_case_		)
            UpperCAmelCase_				:  Union[str, Any]  = DatasetMetadata.from_readme(snake_case_		)
            self.assertDictEqual(snake_case_ ,						{}		)

            with open(snake_case_ ,						'w+'		) as readme_file:
                 readme_file.write(snake_case_		)
            UpperCAmelCase_				:  List[str]  = DatasetMetadata.from_readme(snake_case_		)
            self.assertEqual(snake_case_ ,						{}		)






  def _UpperCamelCase	(					self		):




       '''simple docstring'''

       UpperCAmelCase_				:  int  = _dedent(
           '\\n            annotations_creators:\n            - found\n            language_creators:\n            - found\n            language:\n            - en\n            license:\n            - unknown\n            multilinguality:\n            - monolingual\n            pretty_name: Test Dataset\n            size_categories:\n            - 10K<n<100K\n            source_datasets:\n            - extended|other-yahoo-webscope-l6\n            task_categories:\n            - question-answering\n            task_ids:\n            - open-domain-qa\n            '		)
       assert DatasetMetadata.from_yaml_string(snake_case_		)

       UpperCAmelCase_				:  int  = _dedent(
           '\\n            annotations_creators:\n            - found\n            language:\n            - en\n            license:\n            - unknown\n            multilinguality:\n            - monolingual\n            pretty_name: Test Dataset\n            size_categories:\n            - 10K<n<100K\n            source_datasets:\n            - extended|other-yahoo-webscope-l6\n            task_categories:\n            - question-answering\n            task_ids:\n            - open-domain-qa\n            task_ids:\n            - open-domain-qa\n            '		)
       with self.assertRaises(snake_case_		):
            DatasetMetadata.from_yaml_string(snake_case_		)

       UpperCAmelCase_				:  str  = _dedent(
           '\\n            annotations_creators:\n            - found\n            language_creators:\n            - found\n            language:\n            - en\n            license:\n            - unknown\n            multilinguality:\n            - monolingual\n            pretty_name: Test Dataset\n            size_categories:\n            - 10K<n<100K\n            source_datasets:\n            - extended|other-yahoo-webscope-l6\n            task_categories:\n            - text-classification\n            task_ids:\n            - multi-class-classification\n            paperswithcode_id:\n            - squad\n            configs:\n            - en\n            train-eval-index:\n            - config: en\n              task: text-classification\n              task_id: multi_class_classification\n              splits:\n                train_split: train\n                eval_split: test\n              col_mapping:\n                text: text\n                label: target\n              metrics:\n                - type: accuracy\n                  name: Accuracy\n            extra_gated_prompt: |\n              By clicking on “Access repository” below, you also agree to ImageNet Terms of Access:\n              [RESEARCHER_FULLNAME] (the "Researcher") has requested permission to use the ImageNet database (the "Database") at Princeton University and Stanford University. In exchange for such permission, Researcher hereby agrees to the following terms and conditions:\n              1. Researcher shall use the Database only for non-commercial research and educational purposes.\n            extra_gated_fields:\n              Company: text\n              Country: text\n              I agree to use this model for non-commerical use ONLY: checkbox\n            '		)
       assert DatasetMetadata.from_yaml_string(snake_case_		)






