
'''simple docstring'''
import json
import os
from pathlib import Path

import pytest

from datasets.download.download_config import DownloadConfig
from datasets.download.download_manager import DownloadManager
from datasets.utils.file_utils import hash_url_to_filename


__lowerCAmelCase					=			'http://www.mocksite.com/file1.txt'
__lowerCAmelCase					=			'\"text\": [\"foo\", \"foo\"]'
__lowerCAmelCase					=			'6d8ce9aa78a471c7477201efbeabd3bb01ac2e7d100a6dc024ba1608361f90a8'


class      _lowerCAmelCase       :







							'''simple docstring'''

							lowerCAmelCase_   		=		2_00
							lowerCAmelCase_   		=		{"""Content-Length""": """100"""}
							lowerCAmelCase_   		=		{}

							def 			lowercase				(self    ,    **UpperCAmelCase    )	->  List[Any]:
														return [bytes(__UpperCAmelCase    ,    """utf-8"""    )]






def    __SCREAMING_SNAKE_CASE (    *_SCREAMING_SNAKE_CASE				,   **_SCREAMING_SNAKE_CASE ):
							return MockResponse()






@pytest.mark.parametrize("""urls_type"""				,   [str, list, dict] )
def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
							import requests

							monkeypatch.setattr(_SCREAMING_SNAKE_CASE				,   """request"""				,   _SCREAMING_SNAKE_CASE )

							_snake_case  =    URL
							if issubclass(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
														_snake_case  =    url
							elif issubclass(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
														_snake_case  =    [url]
							elif issubclass(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
														_snake_case  =    {'train': url}
							_snake_case  =    'dummy'
							_snake_case  =    'downloads'
							_snake_case  =    tmp_path
							_snake_case  =    DownloadConfig(
							    cache_dir=os.path.join(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE )				,   use_etag=_SCREAMING_SNAKE_CASE				,   )
							_snake_case  =    DownloadManager(dataset_name=_SCREAMING_SNAKE_CASE				,   download_config=_SCREAMING_SNAKE_CASE )
							_snake_case  =    dl_manager.download(_SCREAMING_SNAKE_CASE )
							_snake_case  =    urls
							for downloaded_paths in [downloaded_paths]:
														if isinstance(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
																					_snake_case  =    [downloaded_paths]
																					_snake_case  =    [urls]
														elif isinstance(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
																					assert "train" in downloaded_paths.keys()
																					_snake_case  =    downloaded_paths.values()
																					_snake_case  =    urls.values()
														assert downloaded_paths
														for downloaded_path, input_url in zip(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
																					assert downloaded_path == dl_manager.downloaded_paths[input_url]
																					_snake_case  =    Path(_SCREAMING_SNAKE_CASE )
																					_snake_case  =    downloaded_path.parts
																					assert parts[-1] == HASH
																					assert parts[-2] == cache_subdir
																					assert downloaded_path.exists()
																					_snake_case  =    downloaded_path.read_text()
																					assert content == CONTENT
																					_snake_case  =    downloaded_path.with_suffix(""".json""" )
																					assert metadata_downloaded_path.exists()
																					_snake_case  =    json.loads(metadata_downloaded_path.read_text() )
																					assert metadata_content == {"url": URL, "etag": None}






@pytest.mark.parametrize("""paths_type"""				,   [str, list, dict] )
def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
							_snake_case  =    str(_SCREAMING_SNAKE_CASE )
							if issubclass(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
														_snake_case  =    filename
							elif issubclass(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
														_snake_case  =    [filename]
							elif issubclass(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
														_snake_case  =    {'train': filename}
							_snake_case  =    'dummy'
							_snake_case  =    xz_file.parent
							_snake_case  =    'extracted'
							_snake_case  =    DownloadConfig(
							    cache_dir=_SCREAMING_SNAKE_CASE				,   use_etag=_SCREAMING_SNAKE_CASE				,   )
							_snake_case  =    DownloadManager(dataset_name=_SCREAMING_SNAKE_CASE				,   download_config=_SCREAMING_SNAKE_CASE )
							_snake_case  =    dl_manager.extract(_SCREAMING_SNAKE_CASE )
							_snake_case  =    paths
							for extracted_paths in [extracted_paths]:
														if isinstance(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
																					_snake_case  =    [extracted_paths]
																					_snake_case  =    [paths]
														elif isinstance(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
																					assert "train" in extracted_paths.keys()
																					_snake_case  =    extracted_paths.values()
																					_snake_case  =    paths.values()
														assert extracted_paths
														for extracted_path, input_path in zip(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
																					assert extracted_path == dl_manager.extracted_paths[input_path]
																					_snake_case  =    Path(_SCREAMING_SNAKE_CASE )
																					_snake_case  =    extracted_path.parts
																					assert parts[-1] == hash_url_to_filename(_SCREAMING_SNAKE_CASE				,   etag=_SCREAMING_SNAKE_CASE )
																					assert parts[-2] == extracted_subdir
																					assert extracted_path.exists()
																					_snake_case  =    extracted_path.read_text()
																					_snake_case  =    text_file.read_text()
																					assert extracted_file_content == expected_file_content






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
							assert path.endswith(""".jsonl""" )
							for num_items, line in enumerate(_SCREAMING_SNAKE_CASE				,   start=1 ):
														_snake_case  =    json.loads(line.decode("""utf-8""" ) )
														assert item.keys() == {"col_1", "col_2", "col_3"}
							assert num_items == 4






@pytest.mark.parametrize("""archive_jsonl"""				,   ["""tar_jsonl_path""", """zip_jsonl_path"""] )
def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
							_snake_case  =    request.getfixturevalue(_SCREAMING_SNAKE_CASE )
							_snake_case  =    DownloadManager()
							for num_jsonl, (path, file) in enumerate(dl_manager.iter_archive(_SCREAMING_SNAKE_CASE )				,   start=1 ):
														_test_jsonl(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE )
							assert num_jsonl == 2






@pytest.mark.parametrize("""archive_nested_jsonl"""				,   ["""tar_nested_jsonl_path""", """zip_nested_jsonl_path"""] )
def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE ):
							_snake_case  =    request.getfixturevalue(_SCREAMING_SNAKE_CASE )
							_snake_case  =    DownloadManager()
							for num_tar, (path, file) in enumerate(dl_manager.iter_archive(_SCREAMING_SNAKE_CASE )				,   start=1 ):
														for num_jsonl, (subpath, subfile) in enumerate(dl_manager.iter_archive(_SCREAMING_SNAKE_CASE )				,   start=1 ):
																					_test_jsonl(_SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE )
							assert num_tar == 1
							assert num_jsonl == 2






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE ):
							_snake_case  =    DownloadManager()
							for num_file, file in enumerate(dl_manager.iter_files(_SCREAMING_SNAKE_CASE )				,   start=1 ):
														assert os.path.basename(_SCREAMING_SNAKE_CASE ) == ("test.txt" if num_file == 1 else "train.txt")
							assert num_file == 2






"""simple docstring"""





from __future__ import annotations

import math
def 					__A  (_SCREAMING_SNAKE_CASE     )   ->bool:





  """simple docstring"""


  if 1 < number < 4:
    # 2 and 3 are primes
    return True
  elif number < 2 or number % 2 == 0 or number % 3 == 0:
    # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
    return False

  # All primes number are in format of 6k +/- 1
  for i in range(5	,  int(math.sqrt(_SCREAMING_SNAKE_CASE     ) + 1     )	,  6     ):
    if number % i == 0 or number % (i + 2) == 0:
      return False
  return True


__A											=						[num for num in range(3, 10_0001, 2) if not is_prime(num)]
def 					__A  (_SCREAMING_SNAKE_CASE     )   ->list[int]:





  """simple docstring"""


  if not isinstance(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     ):
    raise ValueError('n must be an integer'     )
  if n <= 0:
    raise ValueError('n must be >= 0'     )

  lowerCAmelCase__     :Tuple											=				[]
  for num in range(len(_SCREAMING_SNAKE_CASE     )     ):
    lowerCAmelCase__     :int											=				0
    while 2 * i * i <= odd_composites[num]:
      lowerCAmelCase__     :int											=				odd_composites[num] - 2 * i * i
      if is_prime(_SCREAMING_SNAKE_CASE     ):
        break
      i += 1
    else:
      list_nums.append(odd_composites[num]     )
      if len(_SCREAMING_SNAKE_CASE     ) == n:
        return list_nums

  return []
def 					__A  ()   ->int:





  """simple docstring"""


  return compute_nums(1     )[0]


if __name__ == "__main__":
  print(F'''{solution() = }''')
