





'''simple docstring'''

import pytest

from datasets import Dataset, DatasetDict, Features, NamedSplit, Value
from datasets.io.text import TextDatasetReader

from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases







def    a__							(							lowercase   :	int,   lowercase   :	Union[str, Any] )						->						List[Any]:





     """simple docstring"""

     assert isinstance(lowercase,   lowercase )
     assert dataset.num_rows == 4
     assert dataset.num_columns == 1
     assert dataset.column_names == ["text"]
     for feature, expected_dtype in expected_features.items():
          assert dataset.features[feature].dtype == expected_dtype







@pytest.mark.parametrize('''keep_in_memory''',   [False, True] )
def    a__							(							lowercase   :	Optional[int],   lowercase   :	Union[str, Any],   lowercase   :	int )						->						Tuple:





     """simple docstring"""

     _UpperCamelCase							       =			tmp_path / '''cache'''
     _UpperCamelCase							       =			{'''text''': '''string'''}
     with assert_arrow_memory_increases() if keep_in_memory else assert_arrow_memory_doesnt_increase():
          _UpperCamelCase							       =			TextDatasetReader(lowercase,   cache_dir=lowercase,   keep_in_memory=lowercase ).read()
     _check_text_dataset(lowercase,   lowercase )







@pytest.mark.parametrize(
    '''features''',   [
        None,
        {'''text''': '''string'''},
        {'''text''': '''int32'''},
        {'''text''': '''float32'''},
    ],   )
def    a__							(							lowercase   :	Dict,   lowercase   :	Union[str, Any],   lowercase   :	int )						->						List[Any]:





     """simple docstring"""

     _UpperCamelCase							       =			tmp_path / '''cache'''
     _UpperCamelCase							       =			{'''text''': '''string'''}
     _UpperCamelCase							       =			features.copy() if features else default_expected_features
     _UpperCamelCase							       =			(
         Features({feature: Value(lowercase ) for feature, dtype in features.items()} ) if features is not None else None
     )
     _UpperCamelCase							       =			TextDatasetReader(lowercase,   features=lowercase,   cache_dir=lowercase ).read()
     _check_text_dataset(lowercase,   lowercase )







@pytest.mark.parametrize('''split''',   [None, NamedSplit('''train''' ), '''train''', '''test'''] )
def    a__							(							lowercase   :	Optional[int],   lowercase   :	Any,   lowercase   :	str )						->						Tuple:





     """simple docstring"""

     _UpperCamelCase							       =			tmp_path / '''cache'''
     _UpperCamelCase							       =			{'''text''': '''string'''}
     _UpperCamelCase							       =			TextDatasetReader(lowercase,   cache_dir=lowercase,   split=lowercase ).read()
     _check_text_dataset(lowercase,   lowercase )
     assert dataset.split == split if split else "train"







@pytest.mark.parametrize('''path_type''',   [str, list] )
def    a__							(							lowercase   :	str,   lowercase   :	int,   lowercase   :	Dict )						->						Optional[Any]:





     """simple docstring"""

     if issubclass(lowercase,   lowercase ):
          _UpperCamelCase							       =			text_path
     elif issubclass(lowercase,   lowercase ):
          _UpperCamelCase							       =			[text_path]
     _UpperCamelCase							       =			tmp_path / '''cache'''
     _UpperCamelCase							       =			{'''text''': '''string'''}
     _UpperCamelCase							       =			TextDatasetReader(lowercase,   cache_dir=lowercase ).read()
     _check_text_dataset(lowercase,   lowercase )







def    a__							(							lowercase   :	Optional[int],   lowercase   :	Optional[int],   lowercase   :	int=("train",) )						->						List[str]:





     """simple docstring"""

     assert isinstance(lowercase,   lowercase )
     for split in splits:
          _UpperCamelCase							       =			dataset_dict[split]
          assert dataset.num_rows == 4
          assert dataset.num_columns == 1
          assert dataset.column_names == ["text"]
          for feature, expected_dtype in expected_features.items():
               assert dataset.features[feature].dtype == expected_dtype







@pytest.mark.parametrize('''keep_in_memory''',   [False, True] )
def    a__							(							lowercase   :	str,   lowercase   :	Optional[Any],   lowercase   :	int )						->						int:





     """simple docstring"""

     _UpperCamelCase							       =			tmp_path / '''cache'''
     _UpperCamelCase							       =			{'''text''': '''string'''}
     with assert_arrow_memory_increases() if keep_in_memory else assert_arrow_memory_doesnt_increase():
          _UpperCamelCase							       =			TextDatasetReader({'''train''': text_path},   cache_dir=lowercase,   keep_in_memory=lowercase ).read()
     _check_text_datasetdict(lowercase,   lowercase )







@pytest.mark.parametrize(
    '''features''',   [
        None,
        {'''text''': '''string'''},
        {'''text''': '''int32'''},
        {'''text''': '''float32'''},
    ],   )
def    a__							(							lowercase   :	Optional[Any],   lowercase   :	Dict,   lowercase   :	int )						->						Any:





     """simple docstring"""

     _UpperCamelCase							       =			tmp_path / '''cache'''
     # CSV file loses col_1 string dtype information: default now is "int64" instead of "string"
     _UpperCamelCase							       =			{'''text''': '''string'''}
     _UpperCamelCase							       =			features.copy() if features else default_expected_features
     _UpperCamelCase							       =			(
         Features({feature: Value(lowercase ) for feature, dtype in features.items()} ) if features is not None else None
     )
     _UpperCamelCase							       =			TextDatasetReader({'''train''': text_path},   features=lowercase,   cache_dir=lowercase ).read()
     _check_text_datasetdict(lowercase,   lowercase )







@pytest.mark.parametrize('''split''',   [None, NamedSplit('''train''' ), '''train''', '''test'''] )
def    a__							(							lowercase   :	List[Any],   lowercase   :	Optional[int],   lowercase   :	Any )						->						Dict:





     """simple docstring"""

     if split:
          _UpperCamelCase							       =			{split: text_path}
     else:
          _UpperCamelCase							       =			'''train'''
          _UpperCamelCase							       =			{'''train''': text_path, '''test''': text_path}
     _UpperCamelCase							       =			tmp_path / '''cache'''
     _UpperCamelCase							       =			{'''text''': '''string'''}
     _UpperCamelCase							       =			TextDatasetReader(lowercase,   cache_dir=lowercase ).read()
     _check_text_datasetdict(lowercase,   lowercase,   splits=list(path.keys() ) )
     assert all(dataset[split].split == split for split in path.keys() )






from __future__ import annotations


def 					_UpperCAmelCase				(						a__  ,	a__):

			'''simple docstring'''



			a_						:						List[str] 							= 0
			a_						:						str 							= len(a__) - 1

			while i < j:
						if nums[i] + nums[j] == target:
									return [i, j]
						elif nums[i] + nums[j] < target:
									a_						:						List[Any] 							= i + 1
						else:
									a_						:						Optional[Any] 							= j - 1

			return []


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	print(F"""{two_pointer([2, 7, 11, 15], 9) = }""")


