


import contextlib
import csv
import json
import os
import sqlitea
import tarfile
import textwrap
import zipfile

import pyarrow as pa
import pyarrow.parquet as pq
import pytest

import datasets
import datasets.config

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     )    ->						Optional[int]:


							'''simple docstring'''





							_UpperCAmelCase											=     1_0
							_UpperCAmelCase											=     datasets.Features(
							    {
							        'tokens': datasets.Sequence(datasets.Value('string'			)			),
							        'labels': datasets.Sequence(datasets.ClassLabel(names=['negative', 'positive']			)			),
							        'answers': datasets.Sequence(
							            {
							                'text': datasets.Value('string'			),
							                'answer_start': datasets.Value('int32'			),
							            }			),
							        'id': datasets.Value('int64'			),
							    }			)
							_UpperCAmelCase											=     datasets.Dataset.from_dict(
							    {
							        'tokens': [['foo'] * 5] * n,
							        'labels': [[1] * 5] * n,
							        'answers': [{'answer_start': [9_7], 'text': ['1976']}] * 1_0,
							        'id': list(range(a__			)			),
							    }     ,    features=a__     ,    )
							return dataset

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Tuple     ,    a__:						List[str]			)    ->						List[str]:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'file.arrow'			)
							dataset.map(cache_file_name=a__			)
							return filename


# FILE_CONTENT + files


lowerCAmelCase__    :str       =				'''\
    Text data.
    Second line of data.'''

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Dict			)    ->						Union[str, Any]:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'file.txt'
							_UpperCAmelCase											=     FILE_CONTENT
							with open(a__     ,    'w'			) as f:
														f.write(a__			)
							return filename

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Optional[Any]			)    ->						Optional[int]:


							'''simple docstring'''





							import bza

							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'file.txt.bz2'
							_UpperCAmelCase											=     bytes(a__     ,    'utf-8'			)
							with bza.open(a__     ,    'wb'			) as f:
														f.write(a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Dict			)    ->						Optional[int]:


							'''simple docstring'''





							import gzip

							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'file.txt.gz'			)
							_UpperCAmelCase											=     bytes(a__     ,    'utf-8'			)
							with gzip.open(a__     ,    'wb'			) as f:
														f.write(a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						int			)    ->						Any:


							'''simple docstring'''





							if datasets.config.LZ4_AVAILABLE:
														import lza.frame

														_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'file.txt.lz4'
														_UpperCAmelCase											=     bytes(a__     ,    'utf-8'			)
														with lza.frame.open(a__     ,    'wb'			) as f:
																					f.write(a__			)
														return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						List[Any]     ,    a__:						Any			)    ->						List[Any]:


							'''simple docstring'''





							if datasets.config.PY7ZR_AVAILABLE:
														import pyazr

														_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'file.txt.7z'
														with pyazr.SevenZipFile(a__     ,    'w'			) as archive:
																					archive.write(a__     ,    arcname=os.path.basename(a__			)			)
														return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Optional[Any]     ,    a__:						Any			)    ->						str:


							'''simple docstring'''





							import tarfile

							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'file.txt.tar'
							with tarfile.TarFile(a__     ,    'w'			) as f:
														f.add(a__     ,    arcname=os.path.basename(a__			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Dict			)    ->						Any:


							'''simple docstring'''





							import lzma

							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'file.txt.xz'
							_UpperCAmelCase											=     bytes(a__     ,    'utf-8'			)
							with lzma.open(a__     ,    'wb'			) as f:
														f.write(a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Union[str, Any]     ,    a__:						Any			)    ->						List[str]:


							'''simple docstring'''





							import zipfile

							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'file.txt.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.basename(a__			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Any			)    ->						List[str]:


							'''simple docstring'''





							if datasets.config.ZSTANDARD_AVAILABLE:
														import zstandard as zstd

														_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'file.txt.zst'
														_UpperCAmelCase											=     bytes(a__     ,    'utf-8'			)
														with zstd.open(a__     ,    'wb'			) as f:
																					f.write(a__			)
														return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Optional[int]			)    ->						Any:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'file.xml'
							_UpperCAmelCase											=     textwrap.dedent(
							    '\\n    <?xml version="1.0" encoding="UTF-8" ?>\n    <tmx version="1.4">\n      <header segtype="sentence" srclang="ca" />\n      <body>\n        <tu>\n          <tuv xml:lang="ca"><seg>Contingut 1</seg></tuv>\n          <tuv xml:lang="en"><seg>Content 1</seg></tuv>\n        </tu>\n        <tu>\n          <tuv xml:lang="ca"><seg>Contingut 2</seg></tuv>\n          <tuv xml:lang="en"><seg>Content 2</seg></tuv>\n        </tu>\n        <tu>\n          <tuv xml:lang="ca"><seg>Contingut 3</seg></tuv>\n          <tuv xml:lang="en"><seg>Content 3</seg></tuv>\n        </tu>\n        <tu>\n          <tuv xml:lang="ca"><seg>Contingut 4</seg></tuv>\n          <tuv xml:lang="en"><seg>Content 4</seg></tuv>\n        </tu>\n        <tu>\n          <tuv xml:lang="ca"><seg>Contingut 5</seg></tuv>\n          <tuv xml:lang="en"><seg>Content 5</seg></tuv>\n        </tu>\n      </body>\n    </tmx>'			)
							with open(a__     ,    'w'			) as f:
														f.write(a__			)
							return filename


lowerCAmelCase__    :Tuple       =				[
    {'''col_1''': '''0''', '''col_2''': 0, '''col_3''': 0.0},
    {'''col_1''': '''1''', '''col_2''': 1, '''col_3''': 1.0},
    {'''col_1''': '''2''', '''col_2''': 2, '''col_3''': 2.0},
    {'''col_1''': '''3''', '''col_2''': 3, '''col_3''': 3.0},
]
lowerCAmelCase__    :List[Any]       =				[
    {'''col_1''': '''4''', '''col_2''': 4, '''col_3''': 4.0},
    {'''col_1''': '''5''', '''col_2''': 5, '''col_3''': 5.0},
]
lowerCAmelCase__    :List[Any]       =				{
    '''col_1''': ['''0''', '''1''', '''2''', '''3'''],
    '''col_2''': [0, 1, 2, 3],
    '''col_3''': [0.0, 1.0, 2.0, 3.0],
}

lowerCAmelCase__    :int       =				[
    {'''col_3''': 0.0, '''col_1''': '''0''', '''col_2''': 0},
    {'''col_3''': 1.0, '''col_1''': '''1''', '''col_2''': 1},
]

lowerCAmelCase__    :Tuple       =				[
    {'''col_1''': '''s0''', '''col_2''': 0, '''col_3''': 0.0},
    {'''col_1''': '''s1''', '''col_2''': 1, '''col_3''': 1.0},
    {'''col_1''': '''s2''', '''col_2''': 2, '''col_3''': 2.0},
    {'''col_1''': '''s3''', '''col_2''': 3, '''col_3''': 3.0},
]

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     )    ->						Optional[int]:


							'''simple docstring'''





							return DATA_DICT_OF_LISTS

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Tuple			)    ->						Tuple:


							'''simple docstring'''





							_UpperCAmelCase											=     datasets.Dataset.from_dict(a__			)
							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.arrow'			)
							dataset.map(cache_file_name=a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Dict			)    ->						Tuple:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.sqlite'			)
							with contextlib.closing(sqlitea.connect(a__			)			) as con:
														_UpperCAmelCase											=     con.cursor()
														cur.execute('CREATE TABLE dataset(col_1 text, col_2 int, col_3 real)'			)
														for item in DATA:
																					cur.execute('INSERT INTO dataset(col_1, col_2, col_3) VALUES (?, ?, ?)'     ,    tuple(item.values()			)			)
														con.commit()
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Union[str, Any]			)    ->						Any:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.csv'			)
							with open(a__     ,    'w'     ,    newline=''			) as f:
														_UpperCAmelCase											=     csv.DictWriter(a__     ,    fieldnames=['col_1', 'col_2', 'col_3']			)
														writer.writeheader()
														for item in DATA:
																					writer.writerow(a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Optional[int]			)    ->						str:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset2.csv'			)
							with open(a__     ,    'w'     ,    newline=''			) as f:
														_UpperCAmelCase											=     csv.DictWriter(a__     ,    fieldnames=['col_1', 'col_2', 'col_3']			)
														writer.writeheader()
														for item in DATA:
																					writer.writerow(a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Tuple     ,    a__:						List[str]			)    ->						Dict:


							'''simple docstring'''





							import bza

							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset.csv.bz2'
							with open(a__     ,    'rb'			) as f:
														_UpperCAmelCase											=     f.read()
							# data = bytes(FILE_CONTENT, "utf-8")
							with bza.open(a__     ,    'wb'			) as f:
														f.write(a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						List[Any]     ,    a__:						Union[str, Any]     ,    a__:						List[Any]			)    ->						List[Any]:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset.csv.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.basename(a__			)			)
														f.write(a__     ,    arcname=os.path.basename(a__			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Dict     ,    a__:						List[Any]     ,    a__:						Tuple			)    ->						Dict:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset.csv.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.basename(csv_path.replace('.csv'     ,    '.CSV'			)			)			)
														f.write(a__     ,    arcname=os.path.basename(csva_path.replace('.csv'     ,    '.CSV'			)			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Any     ,    a__:						Tuple     ,    a__:						List[str]			)    ->						int:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset_with_dir.csv.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.join('main_dir'     ,    os.path.basename(a__			)			)			)
														f.write(a__     ,    arcname=os.path.join('main_dir'     ,    os.path.basename(a__			)			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Dict			)    ->						Tuple:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.parquet'			)
							_UpperCAmelCase											=     pa.schema(
							    {
							        'col_1': pa.string(),
							        'col_2': pa.intaa(),
							        'col_3': pa.floataa(),
							    }			)
							with open(a__     ,    'wb'			) as f:
														_UpperCAmelCase											=     pq.ParquetWriter(a__     ,    schema=a__			)
														_UpperCAmelCase											=     pa.Table.from_pydict({k: [DATA[i][k] for i in range(len(a__			)			)] for k in DATA[0]}     ,    schema=a__			)
														writer.write_table(a__			)
														writer.close()
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Optional[Any]			)    ->						Tuple:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.json'			)
							_UpperCAmelCase											=     {'data': DATA}
							with open(a__     ,    'w'			) as f:
														json.dump(a__     ,    a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Dict			)    ->						Union[str, Any]:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.json'			)
							_UpperCAmelCase											=     {'data': DATA_DICT_OF_LISTS}
							with open(a__     ,    'w'			) as f:
														json.dump(a__     ,    a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Dict			)    ->						Tuple:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.jsonl'			)
							with open(a__     ,    'w'			) as f:
														for item in DATA:
																					f.write(json.dumps(a__			) + '\n'			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Dict			)    ->						Optional[int]:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset2.jsonl'			)
							with open(a__     ,    'w'			) as f:
														for item in DATA:
																					f.write(json.dumps(a__			) + '\n'			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Any			)    ->						int:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset_312.jsonl'			)
							with open(a__     ,    'w'			) as f:
														for item in DATA_312:
																					f.write(json.dumps(a__			) + '\n'			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						List[Any]			)    ->						Union[str, Any]:


							'''simple docstring'''





							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset-str.jsonl'			)
							with open(a__     ,    'w'			) as f:
														for item in DATA_STR:
																					f.write(json.dumps(a__			) + '\n'			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Union[str, Any]     ,    a__:						str			)    ->						Union[str, Any]:


							'''simple docstring'''





							import gzip

							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.txt.gz'			)
							with open(a__     ,    'rb'			) as orig_file:
														with gzip.open(a__     ,    'wb'			) as zipped_file:
																					zipped_file.writelines(a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Optional[int]     ,    a__:						Optional[int]			)    ->						Union[str, Any]:


							'''simple docstring'''





							import gzip

							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.jsonl.gz'			)
							with open(a__     ,    'rb'			) as orig_file:
														with gzip.open(a__     ,    'wb'			) as zipped_file:
																					zipped_file.writelines(a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Union[str, Any]     ,    a__:						Dict     ,    a__:						Tuple			)    ->						Dict:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset.jsonl.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.basename(a__			)			)
														f.write(a__     ,    arcname=os.path.basename(a__			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Optional[int]     ,    a__:						Optional[int]     ,    a__:						List[Any]     ,    a__:						int			)    ->						List[Any]:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset_nested.jsonl.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.join('nested'     ,    os.path.basename(a__			)			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						List[str]     ,    a__:						Optional[Any]     ,    a__:						List[Any]			)    ->						Optional[int]:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset_with_dir.jsonl.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.join('main_dir'     ,    os.path.basename(a__			)			)			)
														f.write(a__     ,    arcname=os.path.join('main_dir'     ,    os.path.basename(a__			)			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						List[str]     ,    a__:						List[str]     ,    a__:						str			)    ->						Tuple:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset.jsonl.tar'
							with tarfile.TarFile(a__     ,    'w'			) as f:
														f.add(a__     ,    arcname=os.path.basename(a__			)			)
														f.add(a__     ,    arcname=os.path.basename(a__			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Optional[Any]     ,    a__:						Optional[int]     ,    a__:						List[str]     ,    a__:						Tuple			)    ->						int:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset_nested.jsonl.tar'
							with tarfile.TarFile(a__     ,    'w'			) as f:
														f.add(a__     ,    arcname=os.path.join('nested'     ,    os.path.basename(a__			)			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						str			)    ->						List[str]:


							'''simple docstring'''





							_UpperCAmelCase											=     ['0', '1', '2', '3']
							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset.txt'			)
							with open(a__     ,    'w'			) as f:
														for item in data:
																					f.write(item + '\n'			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Optional[int]			)    ->						Any:


							'''simple docstring'''





							_UpperCAmelCase											=     ['0', '1', '2', '3']
							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset2.txt'			)
							with open(a__     ,    'w'			) as f:
														for item in data:
																					f.write(item + '\n'			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						str			)    ->						Optional[int]:


							'''simple docstring'''





							_UpperCAmelCase											=     ['0', '1', '2', '3']
							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset.abc'
							with open(a__     ,    'w'			) as f:
														for item in data:
																					f.write(item + '\n'			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						int     ,    a__:						Tuple     ,    a__:						Dict			)    ->						Dict:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset.text.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.basename(a__			)			)
														f.write(a__     ,    arcname=os.path.basename(a__			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Any     ,    a__:						int     ,    a__:						Dict			)    ->						Optional[int]:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset_with_dir.text.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.join('main_dir'     ,    os.path.basename(a__			)			)			)
														f.write(a__     ,    arcname=os.path.join('main_dir'     ,    os.path.basename(a__			)			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Tuple     ,    a__:						List[str]     ,    a__:						Optional[Any]			)    ->						Dict:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset.ext.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.basename('unsupported.ext'			)			)
														f.write(a__     ,    arcname=os.path.basename('unsupported_2.ext'			)			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Union[str, Any]			)    ->						Dict:


							'''simple docstring'''





							_UpperCAmelCase											=     '\n'.join(['First', 'Second\u2029with Unicode new line', 'Third']			)
							_UpperCAmelCase											=     str(tmp_path_factory.mktemp('data'			) / 'dataset_with_unicode_new_lines.txt'			)
							with open(a__     ,    'w'     ,    encoding='utf-8'			) as f:
														f.write(a__			)
							return path

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     )    ->						Dict:


							'''simple docstring'''





							return os.path.join('tests'     ,    'features'     ,    'data'     ,    'test_image_rgb.jpg'			)

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     )    ->						Optional[int]:


							'''simple docstring'''





							return os.path.join('tests'     ,    'features'     ,    'data'     ,    'test_audio_44100.wav'			)

@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						Union[str, Any]     ,    a__:						str			)    ->						Tuple:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data'			) / 'dataset.img.zip'
							with zipfile.ZipFile(a__     ,    'w'			) as f:
														f.write(a__     ,    arcname=os.path.basename(a__			)			)
														f.write(a__     ,    arcname=os.path.basename(a__			).replace('.jpg'     ,    '2.jpg'			)			)
							return path







@pytest.fixture(scope='session'			)
def 			lowerCAmelCase__					(     a__:						int			)    ->						Dict:


							'''simple docstring'''





							_UpperCAmelCase											=     tmp_path_factory.mktemp('data_dir'			)

							(data_dir / "subdir").mkdir()
							with open(data_dir / 'subdir' / 'train.txt'     ,    'w'			) as f:
														f.write('foo\n' * 1_0			)
							with open(data_dir / 'subdir' / 'test.txt'     ,    'w'			) as f:
														f.write('bar\n' * 1_0			)
							# hidden file
							with open(data_dir / 'subdir' / '.test.txt'     ,    'w'			) as f:
														f.write('bar\n' * 1_0			)

							# hidden directory
							(data_dir / ".subdir").mkdir()
							with open(data_dir / '.subdir' / 'train.txt'     ,    'w'			) as f:
														f.write('foo\n' * 1_0			)
							with open(data_dir / '.subdir' / 'test.txt'     ,    'w'			) as f:
														f.write('bar\n' * 1_0			)

							return data_dir




import math

import qiskit

def 			lowerCAmelCase__					(     a__:						int = 1     ,    a__:						int = 1     ,    a__:						int = 1			)    ->						qiskit.result.counts.Counts:


							'''simple docstring'''





							if (
							    isinstance(a__     ,    a__			)
							    or isinstance(a__     ,    a__			)
							    or isinstance(a__     ,    a__			)
							):
														raise TypeError('inputs must be integers.'			)

							if (input_a < 0) or (input_a < 0) or (carry_in < 0):
														raise ValueError('inputs must be positive.'			)

							if (
							    (math.floor(a__			) != input_a)
							    or (math.floor(a__			) != input_a)
							    or (math.floor(a__			) != carry_in)
							):
														raise ValueError('inputs must be exact integers.'			)

							if (input_a > 2) or (input_a > 2) or (carry_in > 2):
														raise ValueError('inputs must be less or equal to 2.'			)

							# build registers
							_UpperCAmelCase											=     qiskit.QuantumRegister(4     ,    'qr'			)
							_UpperCAmelCase											=     qiskit.ClassicalRegister(2     ,    'cr'			)
							# list the entries
							_UpperCAmelCase											=     [input_a, input_a, carry_in]

							_UpperCAmelCase											=     qiskit.QuantumCircuit(a__     ,    a__			)

							for i in range(0     ,    3			):
														if entry[i] == 2:
																					quantum_circuit.h(a__			)  # for hadamard entries
														elif entry[i] == 1:
																					quantum_circuit.x(a__			)  # for 1 entries
														elif entry[i] == 0:
																					quantum_circuit.i(a__			)  # for 0 entries

    # build the circuit
							quantum_circuit.ccx(0     ,    1     ,    3			)  # ccx = toffoli gate
							quantum_circuit.cx(0     ,    1			)
							quantum_circuit.ccx(1     ,    2     ,    3			)
							quantum_circuit.cx(1     ,    2			)
							quantum_circuit.cx(0     ,    1			)

							quantum_circuit.measure([2, 3]     ,    a__			)  # measure the last two qbits

							_UpperCAmelCase											=     qiskit.Aer.get_backend('aer_simulator'			)
							_UpperCAmelCase											=     qiskit.execute(a__     ,    a__     ,    shots=1_0_0_0			)

							return job.result().get_counts(a__			)


if __name__ == "__main__":
		print(f'''Total sum count for state is: {quantum_full_adder(1, 1, 1)}''')
