






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     _snake_case    (__lowercase    ,      __lowercase):
			assert isinstance(lowerCAmelCase__    ,      lowerCAmelCase__)
			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     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase):
			UpperCamelCase_									=     tmp_path / 'cache'
			UpperCamelCase_									=     {'text': 'string'}
			with assert_arrow_memory_increases() if keep_in_memory else assert_arrow_memory_doesnt_increase():
						UpperCamelCase_									=     TextDatasetReader(lowerCAmelCase__    ,      cache_dir=lowerCAmelCase__    ,      keep_in_memory=lowerCAmelCase__).read()
			_check_text_dataset(lowerCAmelCase__    ,      lowerCAmelCase__)






@pytest.mark.parametrize(
    'features'    ,      [
        None,
        {'text': 'string'},
        {'text': 'int32'},
        {'text': 'float32'},
    ]    ,      )
def     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase):
			UpperCamelCase_									=     tmp_path / 'cache'
			UpperCamelCase_									=     {'text': 'string'}
			UpperCamelCase_									=     features.copy() if features else default_expected_features
			UpperCamelCase_									=     (
			    Features({feature: Value(lowerCAmelCase__) for feature, dtype in features.items()}) if features is not None else None
			)
			UpperCamelCase_									=     TextDatasetReader(lowerCAmelCase__    ,      features=lowerCAmelCase__    ,      cache_dir=lowerCAmelCase__).read()
			_check_text_dataset(lowerCAmelCase__    ,      lowerCAmelCase__)






@pytest.mark.parametrize('split'    ,      [None, NamedSplit('train'), 'train', 'test'])
def     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase):
			UpperCamelCase_									=     tmp_path / 'cache'
			UpperCamelCase_									=     {'text': 'string'}
			UpperCamelCase_									=     TextDatasetReader(lowerCAmelCase__    ,      cache_dir=lowerCAmelCase__    ,      split=lowerCAmelCase__).read()
			_check_text_dataset(lowerCAmelCase__    ,      lowerCAmelCase__)
			assert dataset.split == split if split else "train"






@pytest.mark.parametrize('path_type'    ,      [str, list])
def     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase):
			if issubclass(lowerCAmelCase__    ,      lowerCAmelCase__):
						UpperCamelCase_									=     text_path
			elif issubclass(lowerCAmelCase__    ,      lowerCAmelCase__):
						UpperCamelCase_									=     [text_path]
			UpperCamelCase_									=     tmp_path / 'cache'
			UpperCamelCase_									=     {'text': 'string'}
			UpperCamelCase_									=     TextDatasetReader(lowerCAmelCase__    ,      cache_dir=lowerCAmelCase__).read()
			_check_text_dataset(lowerCAmelCase__    ,      lowerCAmelCase__)






def     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase=("train",)):
			assert isinstance(lowerCAmelCase__    ,      lowerCAmelCase__)
			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     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase):
			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=lowerCAmelCase__    ,      keep_in_memory=lowerCAmelCase__).read()
			_check_text_datasetdict(lowerCAmelCase__    ,      lowerCAmelCase__)






@pytest.mark.parametrize(
    'features'    ,      [
        None,
        {'text': 'string'},
        {'text': 'int32'},
        {'text': 'float32'},
    ]    ,      )
def     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase):
			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(lowerCAmelCase__) for feature, dtype in features.items()}) if features is not None else None
			)
			UpperCamelCase_									=     TextDatasetReader({'train': text_path}    ,      features=lowerCAmelCase__    ,      cache_dir=lowerCAmelCase__).read()
			_check_text_datasetdict(lowerCAmelCase__    ,      lowerCAmelCase__)






@pytest.mark.parametrize('split'    ,      [None, NamedSplit('train'), 'train', 'test'])
def     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase):
			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(lowerCAmelCase__    ,      cache_dir=lowerCAmelCase__).read()
			_check_text_datasetdict(lowerCAmelCase__    ,      lowerCAmelCase__    ,      splits=list(path.keys()))
			assert all(dataset[split].split == split for split in path.keys())













def     _snake_case    (__lowercase = 1000):
   UpperCamelCase_		,      UpperCamelCase_									=     1, 1
   UpperCamelCase_									=     2
   while True:
      UpperCamelCase_									=     0
      UpperCamelCase_									=     fa + fa
      UpperCamelCase_		,      UpperCamelCase_									=     fa, f
      index += 1
      for _ in str(__lowercase):
         i += 1
      if i == n:
         break
   return index


if __name__ == "__main__":
 print(solution(int(str(input()).strip())))





