
'''simple docstring'''





from __future__ import annotations

from collections.abc import Callable
from typing import Generic, TypeVar

UpperCAmelCase    					=   TypeVar("T")
UpperCAmelCase    					=   TypeVar("U")

class 						a   (				Generic[T, U]    ):




				def __init__(							self	:				List[Any],    SCREAMING_SNAKE_CASE_	:				T | None,    SCREAMING_SNAKE_CASE_	:				U | None      ):
										snake_case       :     Union[str, Any] =    key
										snake_case       :     Tuple =    val
										snake_case       :     DoubleLinkedListNode[T, U] | None =    None
										snake_case       :     DoubleLinkedListNode[T, U] | None =    None




				def __repr__(							self	:				int      ):
										return (
										    F"""Node: key: {self.key}, val: {self.val}, """
										    F"""has next: {bool(self.next      )}, has prev: {bool(self.prev      )}"""
										)




class 						a   (				Generic[T, U]    ):




				def __init__(							self	:				List[Any]      ):
										snake_case       :     DoubleLinkedListNode[T, U] =    DoubleLinkedListNode(SCREAMING_SNAKE_CASE_,    SCREAMING_SNAKE_CASE_      )
										snake_case       :     DoubleLinkedListNode[T, U] =    DoubleLinkedListNode(SCREAMING_SNAKE_CASE_,    SCREAMING_SNAKE_CASE_      )
										snake_case,					snake_case       :     Any =    self.rear, self.head




				def __repr__(							self	:				Dict      ):
										snake_case       :     Tuple =    ['''DoubleLinkedList''']
										snake_case       :     List[Any] =    self.head
										while node.next is not None:
																rep.append(str(SCREAMING_SNAKE_CASE_      )      )
																snake_case       :     List[Any] =    node.next
										rep.append(str(self.rear      )      )
										return ",\n    ".join(SCREAMING_SNAKE_CASE_      )




				def 	__snake_case							(							self	:				List[Any],    SCREAMING_SNAKE_CASE_	:				DoubleLinkedListNode[T, U]      ):
										snake_case       :     Union[str, Any] =    self.rear.prev

										# All nodes other than self.head are guaranteed to have non-None previous
										assert previous is not None

										snake_case       :     Tuple =    node
										snake_case       :     Optional[Any] =    previous
										snake_case       :     str =    node
										snake_case       :     Any =    self.rear




				def 	__snake_case							(							self	:				Tuple,    SCREAMING_SNAKE_CASE_	:				DoubleLinkedListNode[T, U]      ):

										if node.prev is None or node.next is None:
																return None

										snake_case       :     Dict =    node.next
										snake_case       :     str =    node.prev
										snake_case       :     List[str] =    None
										snake_case       :     int =    None
										return node




class 						a   (				Generic[T, U]    ):
				_snake_case		    = {}




				def __init__(							self	:				Optional[Any],    SCREAMING_SNAKE_CASE_	:				int      ):
										snake_case       :     DoubleLinkedList[T, U] =    DoubleLinkedList()
										snake_case       :     Tuple =    capacity
										snake_case       :     Any =    0
										snake_case       :     List[str] =    0
										snake_case       :     Optional[int] =    0
										snake_case       :     dict[T, DoubleLinkedListNode[T, U]] =    {}




				def __repr__(							self	:				Dict      ):
										return (
										    F"""CacheInfo(hits={self.hits}, misses={self.miss}, """
										    F"""capacity={self.capacity}, current size={self.num_keys})"""
										)




				def __contains__(							self	:				Optional[Any],    SCREAMING_SNAKE_CASE_	:				T      ):
										return key in self.cache




				def 	__snake_case							(							self	:				List[str],    SCREAMING_SNAKE_CASE_	:				T      ):
										# Note: pythonic interface would throw KeyError rather than return None

										if key in self.cache:
																self.hits += 1
																snake_case       :     DoubleLinkedListNode[T, U] =    self.cache[key]
																snake_case       :     List[str] =    self.list.remove(self.cache[key]      )
																assert node == value_node

																# node is guaranteed not None because it is in self.cache
																assert node is not None
																self.list.add(SCREAMING_SNAKE_CASE_      )
																return node.val
										self.miss += 1
										return None




				def 	__snake_case							(							self	:				Dict,    SCREAMING_SNAKE_CASE_	:				T,    SCREAMING_SNAKE_CASE_	:				U      ):

										if key not in self.cache:
																if self.num_keys >= self.capacity:
																						# delete first node (oldest) when over capacity
																						snake_case       :     Optional[int] =    self.list.head.next

																						# guaranteed to have a non-None first node when num_keys > 0
																						# explain to type checker via assertions
																						assert first_node is not None
																						assert first_node.key is not None
																						assert (
																						    self.list.remove(SCREAMING_SNAKE_CASE_      ) is not None
																						)  # node guaranteed to be in list assert node.key is not None

																						del self.cache[first_node.key]
																						self.num_keys -= 1
																snake_case       :     str =    DoubleLinkedListNode(SCREAMING_SNAKE_CASE_,    SCREAMING_SNAKE_CASE_      )
																self.list.add(self.cache[key]      )
																self.num_keys += 1

										else:
																# bump node to the end of the list, update value
																snake_case       :     Optional[int] =    self.list.remove(self.cache[key]      )
																assert node is not None  # node guaranteed to be in list
																snake_case       :     Tuple =    value
																self.list.add(SCREAMING_SNAKE_CASE_      )




				@classmethod
				def 	__snake_case							(							cls	:				int,    SCREAMING_SNAKE_CASE_	:				int = 1_28      ):

										def cache_decorator_inner(SCREAMING_SNAKE_CASE_	:				Callable[[T], U]      ) -> Callable[..., U]:
																def cache_decorator_wrapper(*SCREAMING_SNAKE_CASE_	:				T      ) -> U:
																						if func not in cls.decorator_function_to_instance_map:
																												snake_case       :     int =    LRUCache(SCREAMING_SNAKE_CASE_      )

																						snake_case       :     int =    cls.decorator_function_to_instance_map[func].get(args[0]      )
																						if result is None:
																												snake_case       :     int =    func(*SCREAMING_SNAKE_CASE_      )
																												cls.decorator_function_to_instance_map[func].put(args[0],    SCREAMING_SNAKE_CASE_      )
																						return result

																def cache_info() -> LRUCache[T, U]:
																						return cls.decorator_function_to_instance_map[func]

																setattr(SCREAMING_SNAKE_CASE_,    '''cache_info''',    SCREAMING_SNAKE_CASE_      )  # noqa: B010

																return cache_decorator_wrapper

										return cache_decorator_inner


if __name__ == "__main__":
						import doctest

						doctest.testmod()



'''simple docstring'''





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      A (       ):
						snake_case       :     Dict =    10
						snake_case       :     List[Any] =    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'''       ),
						    }       )
						snake_case       :     Dict =    datasets.Dataset.from_dict(
						    {
						        '''tokens''': [['''foo'''] * 5] * n,
						        '''labels''': [[1] * 5] * n,
						        '''answers''': [{'''answer_start''': [97], '''text''': ['''1976''']}] * 10,
						        '''id''': list(range(A_       )       ),
						    }    ,							features=A_    ,							)
						return dataset

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					List[Any]    ,							A_							:					Optional[Any]       ):
						snake_case       :     Any =    str(tmp_path_factory.mktemp('''data'''       ) / '''file.arrow'''       )
						dataset.map(cache_file_name=A_       )
						return filename


# FILE_CONTENT + files


UpperCAmelCase    					=   "\\n    Text data.\n    Second line of data."

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					List[str]       ):
						snake_case       :     Any =    tmp_path_factory.mktemp('''data'''       ) / '''file.txt'''
						snake_case       :     Union[str, Any] =    FILE_CONTENT
						with open(A_    ,							'''w'''       ) as f:
												f.write(A_       )
						return filename

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					Optional[Any]       ):
						import bza

						snake_case       :     Tuple =    tmp_path_factory.mktemp('''data'''       ) / '''file.txt.bz2'''
						snake_case       :     Union[str, Any] =    bytes(A_    ,							'''utf-8'''       )
						with bza.open(A_    ,							'''wb'''       ) as f:
												f.write(A_       )
						return path

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					List[Any]       ):
						import gzip

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

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					Optional[int]       ):
						if datasets.config.LZ4_AVAILABLE:
												import lza.frame

												snake_case       :     Union[str, Any] =    tmp_path_factory.mktemp('''data'''       ) / '''file.txt.lz4'''
												snake_case       :     Tuple =    bytes(A_    ,							'''utf-8'''       )
												with lza.frame.open(A_    ,							'''wb'''       ) as f:
																		f.write(A_       )
												return path

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					Union[str, Any]    ,							A_							:					str       ):
						if datasets.config.PY7ZR_AVAILABLE:
												import pyazr

												snake_case       :     Optional[Any] =    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      A (       A_							:					List[str]    ,							A_							:					Optional[int]       ):
						import tarfile

						snake_case       :     Union[str, Any] =    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      A (       A_							:					Any       ):
						import lzma

						snake_case       :     Any =    tmp_path_factory.mktemp('''data'''       ) / '''file.txt.xz'''
						snake_case       :     Union[str, Any] =    bytes(A_    ,							'''utf-8'''       )
						with lzma.open(A_    ,							'''wb'''       ) as f:
												f.write(A_       )
						return path

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					Optional[int]    ,							A_							:					Union[str, Any]       ):
						import zipfile

						snake_case       :     List[str] =    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      A (       A_							:					List[str]       ):
						if datasets.config.ZSTANDARD_AVAILABLE:
												import zstandard as zstd

												snake_case       :     Tuple =    tmp_path_factory.mktemp('''data'''       ) / '''file.txt.zst'''
												snake_case       :     List[str] =    bytes(A_    ,							'''utf-8'''       )
												with zstd.open(A_    ,							'''wb'''       ) as f:
																		f.write(A_       )
												return path

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					str       ):
						snake_case       :     Optional[int] =    tmp_path_factory.mktemp('''data'''       ) / '''file.xml'''
						snake_case       :     Any =    textwrap.dedent(
						    '''\
    <?xml version="1.0" encoding="UTF-8" ?>
    <tmx version="1.4">
      <header segtype="sentence" srclang="ca" />
      <body>
        <tu>
          <tuv xml:lang="ca"><seg>Contingut 1</seg></tuv>
          <tuv xml:lang="en"><seg>Content 1</seg></tuv>
        </tu>
        <tu>
          <tuv xml:lang="ca"><seg>Contingut 2</seg></tuv>
          <tuv xml:lang="en"><seg>Content 2</seg></tuv>
        </tu>
        <tu>
          <tuv xml:lang="ca"><seg>Contingut 3</seg></tuv>
          <tuv xml:lang="en"><seg>Content 3</seg></tuv>
        </tu>
        <tu>
          <tuv xml:lang="ca"><seg>Contingut 4</seg></tuv>
          <tuv xml:lang="en"><seg>Content 4</seg></tuv>
        </tu>
        <tu>
          <tuv xml:lang="ca"><seg>Contingut 5</seg></tuv>
          <tuv xml:lang="en"><seg>Content 5</seg></tuv>
        </tu>
      </body>
    </tmx>'''       )
						with open(A_    ,							'''w'''       ) as f:
												f.write(A_       )
						return filename


UpperCAmelCase    					=   [
    {"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},
]
UpperCAmelCase    					=   [
    {"col_1": "4", "col_2": 4, "col_3": 4.0},
    {"col_1": "5", "col_2": 5, "col_3": 5.0},
]
UpperCAmelCase    					=   {
    "col_1": ["0", "1", "2", "3"],
    "col_2": [0, 1, 2, 3],
    "col_3": [0.0, 1.0, 2.0, 3.0],
}

UpperCAmelCase    					=   [
    {"col_3": 0.0, "col_1": "0", "col_2": 0},
    {"col_3": 1.0, "col_1": "1", "col_2": 1},
]

UpperCAmelCase    					=   [
    {"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      A (       ):
						return DATA_DICT_OF_LISTS

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					str       ):
						snake_case       :     str =    datasets.Dataset.from_dict(A_       )
						snake_case       :     List[Any] =    str(tmp_path_factory.mktemp('''data'''       ) / '''dataset.arrow'''       )
						dataset.map(cache_file_name=A_       )
						return path

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					str       ):
						snake_case       :     Optional[int] =    str(tmp_path_factory.mktemp('''data'''       ) / '''dataset.sqlite'''       )
						with contextlib.closing(sqlitea.connect(A_       )       ) as con:
												snake_case       :     Optional[Any] =    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      A (       A_							:					List[str]       ):
						snake_case       :     Any =    str(tmp_path_factory.mktemp('''data'''       ) / '''dataset.csv'''       )
						with open(A_    ,							'''w'''    ,							newline=''''''       ) as f:
												snake_case       :     Optional[int] =    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      A (       A_							:					Optional[int]       ):
						snake_case       :     Optional[int] =    str(tmp_path_factory.mktemp('''data'''       ) / '''dataset2.csv'''       )
						with open(A_    ,							'''w'''    ,							newline=''''''       ) as f:
												snake_case       :     int =    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      A (       A_							:					Optional[Any]    ,							A_							:					Optional[int]       ):
						import bza

						snake_case       :     Optional[int] =    tmp_path_factory.mktemp('''data'''       ) / '''dataset.csv.bz2'''
						with open(A_    ,							'''rb'''       ) as f:
												snake_case       :     Any =    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      A (       A_							:					str    ,							A_							:					int    ,							A_							:					List[Any]       ):
						snake_case       :     Optional[Any] =    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      A (       A_							:					Dict    ,							A_							:					Optional[Any]    ,							A_							:					Dict       ):
						snake_case       :     str =    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      A (       A_							:					Dict    ,							A_							:					Dict    ,							A_							:					Optional[int]       ):
						snake_case       :     Dict =    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      A (       A_							:					Dict       ):
						snake_case       :     List[str] =    str(tmp_path_factory.mktemp('''data'''       ) / '''dataset.parquet'''       )
						snake_case       :     Tuple =    pa.schema(
						    {
						        '''col_1''': pa.string(),
						        '''col_2''': pa.intaa(),
						        '''col_3''': pa.floataa(),
						    }       )
						with open(A_    ,							'''wb'''       ) as f:
												snake_case       :     Dict =    pq.ParquetWriter(A_    ,							schema=A_       )
												snake_case       :     str =    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      A (       A_							:					List[str]       ):
						snake_case       :     Any =    str(tmp_path_factory.mktemp('''data'''       ) / '''dataset.json'''       )
						snake_case       :     Optional[int] =    {'''data''': DATA}
						with open(A_    ,							'''w'''       ) as f:
												json.dump(A_    ,							A_       )
						return path

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					str       ):
						snake_case       :     List[str] =    str(tmp_path_factory.mktemp('''data'''       ) / '''dataset.json'''       )
						snake_case       :     Any =    {'''data''': DATA_DICT_OF_LISTS}
						with open(A_    ,							'''w'''       ) as f:
												json.dump(A_    ,							A_       )
						return path

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					Optional[Any]       ):
						snake_case       :     Optional[Any] =    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      A (       A_							:					List[Any]       ):
						snake_case       :     Optional[int] =    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      A (       A_							:					List[Any]       ):
						snake_case       :     Dict =    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      A (       A_							:					int       ):
						snake_case       :     Dict =    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      A (       A_							:					Optional[int]    ,							A_							:					Optional[int]       ):
						import gzip

						snake_case       :     Dict =    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      A (       A_							:					Optional[int]    ,							A_							:					Any       ):
						import gzip

						snake_case       :     List[Any] =    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      A (       A_							:					str    ,							A_							:					List[str]    ,							A_							:					Optional[int]       ):
						snake_case       :     int =    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      A (       A_							:					List[str]    ,							A_							:					Any    ,							A_							:					Union[str, Any]    ,							A_							:					int       ):
						snake_case       :     List[str] =    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      A (       A_							:					List[str]    ,							A_							:					Dict    ,							A_							:					Any       ):
						snake_case       :     Optional[Any] =    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      A (       A_							:					List[Any]    ,							A_							:					Tuple    ,							A_							:					List[str]       ):
						snake_case       :     int =    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      A (       A_							:					Tuple    ,							A_							:					Any    ,							A_							:					Tuple    ,							A_							:					Optional[Any]       ):
						snake_case       :     List[Any] =    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      A (       A_							:					int       ):
						snake_case       :     int =    ['''0''', '''1''', '''2''', '''3''']
						snake_case       :     Optional[int] =    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      A (       A_							:					List[str]       ):
						snake_case       :     Union[str, Any] =    ['''0''', '''1''', '''2''', '''3''']
						snake_case       :     Optional[int] =    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      A (       A_							:					Optional[int]       ):
						snake_case       :     Optional[int] =    ['''0''', '''1''', '''2''', '''3''']
						snake_case       :     str =    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      A (       A_							:					Optional[Any]    ,							A_							:					Any    ,							A_							:					Union[str, Any]       ):
						snake_case       :     Dict =    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      A (       A_							:					List[str]    ,							A_							:					Union[str, Any]    ,							A_							:					Optional[Any]       ):
						snake_case       :     List[Any] =    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      A (       A_							:					Any    ,							A_							:					Union[str, Any]    ,							A_							:					str       ):
						snake_case       :     List[Any] =    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      A (       A_							:					Union[str, Any]       ):
						snake_case       :     Any =    '''\n'''.join(['''First''', '''Second\u2029with Unicode new line''', '''Third''']       )
						snake_case       :     Optional[int] =    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      A (       ):
						return os.path.join('''tests'''    ,							'''features'''    ,							'''data'''    ,							'''test_image_rgb.jpg'''       )

@pytest.fixture(scope='''session'''       )
def      A (       ):
						return os.path.join('''tests'''    ,							'''features'''    ,							'''data'''    ,							'''test_audio_44100.wav'''       )

@pytest.fixture(scope='''session'''       )
def      A (       A_							:					Optional[Any]    ,							A_							:					Optional[Any]       ):
						snake_case       :     Union[str, Any] =    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      A (       A_							:					Optional[Any]       ):
						snake_case       :     Dict =    tmp_path_factory.mktemp('''data_dir'''       )

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

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

						return data_dir

