





import textwrap

import pyarrow as pa
import pytest

from datasets import Features, Value
from datasets.packaged_modules.json.json import Json





@pytest.fixture
def 						__SCREAMING_SNAKE_CASE  (    UpperCamelCase__			)  ->    Any:







   '''simple docstring'''

   UpperCAmelCase       		=    tmp_path / "file.jsonl"
   UpperCAmelCase       		=    textwrap.dedent(
       '''\\n        {\"col_1\": -1}\n        {\"col_1\": 1, \"col_2\": 2}\n        {\"col_1\": 10, \"col_2\": 20}\n        '''			)
   with open(SCREAMING_SNAKE_CASE_      ,      '''w'''			) as f:
      f.write(SCREAMING_SNAKE_CASE_			)
   return str(SCREAMING_SNAKE_CASE_			)





@pytest.fixture
def 						__SCREAMING_SNAKE_CASE  (    UpperCamelCase__			)  ->    List[str]:







   '''simple docstring'''

   UpperCAmelCase       		=    tmp_path / "file_utf16_encoded.jsonl"
   UpperCAmelCase       		=    textwrap.dedent(
       '''\\n        {\"col_1\": -1}\n        {\"col_1\": 1, \"col_2\": 2}\n        {\"col_1\": 10, \"col_2\": 20}\n        '''			)
   with open(SCREAMING_SNAKE_CASE_      ,      '''w'''      ,      encoding='''utf-16'''			) as f:
      f.write(SCREAMING_SNAKE_CASE_			)
   return str(SCREAMING_SNAKE_CASE_			)





@pytest.fixture
def 						__SCREAMING_SNAKE_CASE  (    UpperCamelCase__			)  ->    str:







   '''simple docstring'''

   UpperCAmelCase       		=    tmp_path / "file_with_list_of_dicts.json"
   UpperCAmelCase       		=    textwrap.dedent(
       '''\\n        [\n            {\"col_1\": -1},\n            {\"col_1\": 1, \"col_2\": 2},\n            {\"col_1\": 10, \"col_2\": 20}\n        ]\n        '''			)
   with open(SCREAMING_SNAKE_CASE_      ,      '''w'''			) as f:
      f.write(SCREAMING_SNAKE_CASE_			)
   return str(SCREAMING_SNAKE_CASE_			)





@pytest.fixture
def 						__SCREAMING_SNAKE_CASE  (    UpperCamelCase__			)  ->    List[Any]:







   '''simple docstring'''

   UpperCAmelCase       		=    tmp_path / "file_with_list_of_dicts_field.json"
   UpperCAmelCase       		=    textwrap.dedent(
       '''\\n        {\n            \"field1\": 1,\n            \"field2\": \"aabb\",\n            \"field3\": [\n                {\"col_1\": -1},\n                {\"col_1\": 1, \"col_2\": 2},\n                {\"col_1\": 10, \"col_2\": 20}\n            ]\n        }\n        '''			)
   with open(SCREAMING_SNAKE_CASE_      ,      '''w'''			) as f:
      f.write(SCREAMING_SNAKE_CASE_			)
   return str(SCREAMING_SNAKE_CASE_			)





@pytest.mark.parametrize(
    '''file_fixture, config_kwargs'''      ,      [
        ('''jsonl_file''', {}),
        ('''jsonl_file_utf16_encoded''', {'''encoding''': '''utf-16'''}),
        ('''json_file_with_list_of_dicts''', {}),
        ('''json_file_with_list_of_dicts_field''', {'''field''': '''field3'''}),
    ]      ,      )
def 						__SCREAMING_SNAKE_CASE  (    UpperCamelCase__      ,      UpperCamelCase__      ,      UpperCamelCase__			)  ->    Any:







   '''simple docstring'''

   UpperCAmelCase       		=    Json(**SCREAMING_SNAKE_CASE_			)
   UpperCAmelCase       		=    json._generate_tables([[request.getfixturevalue(SCREAMING_SNAKE_CASE_			)]]			)
   UpperCAmelCase       		=    pa.concat_tables([table for _, table in generator]			)
   assert pa_table.to_pydict() == {"col_1": [-1, 1, 10], "col_2": [None, 2, 20]}






@pytest.mark.parametrize(
    '''file_fixture, config_kwargs'''      ,      [
        (
            '''jsonl_file''',
            {'''features''': Features({'''col_1''': Value('''int64'''			), '''col_2''': Value('''int64'''			), '''missing_col''': Value('''string'''			)}			)},
        ),
        (
            '''json_file_with_list_of_dicts''',
            {'''features''': Features({'''col_1''': Value('''int64'''			), '''col_2''': Value('''int64'''			), '''missing_col''': Value('''string'''			)}			)},
        ),
        (
            '''json_file_with_list_of_dicts_field''',
            {
                '''field''': '''field3''',
                '''features''': Features(
                    {'''col_1''': Value('''int64'''			), '''col_2''': Value('''int64'''			), '''missing_col''': Value('''string'''			)}			),
            },
        ),
    ]      ,      )
def 						__SCREAMING_SNAKE_CASE  (    UpperCamelCase__      ,      UpperCamelCase__      ,      UpperCamelCase__			)  ->    Optional[Any]:







   '''simple docstring'''

   UpperCAmelCase       		=    Json(**SCREAMING_SNAKE_CASE_			)
   UpperCAmelCase       		=    json._generate_tables([[request.getfixturevalue(SCREAMING_SNAKE_CASE_			)]]			)
   UpperCAmelCase       		=    pa.concat_tables([table for _, table in generator]			)
   assert pa_table.to_pydict() == {"col_1": [-1, 1, 10], "col_2": [None, 2, 20], "missing_col": [None, None, None]}










import math





def 						__SCREAMING_SNAKE_CASE  (    UpperCamelCase__			)  ->    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(UpperCamelCase__			) + 1			)      ,      6			):
						if number % i == 0 or number % (i + 2) == 0:
									return False
			return True





def 						__SCREAMING_SNAKE_CASE  (    UpperCamelCase__ = 6008_5147_5143			)  ->    int:







			'''simple docstring'''

			try:
						UpperCAmelCase       		=    int(UpperCamelCase__			)
			except (TypeError, ValueError):
						raise TypeError('''Parameter n must be int or castable to int.'''			)
			if n <= 0:
						raise ValueError('''Parameter n must be greater than or equal to one.'''			)
			UpperCAmelCase       		=    0
			if is_prime(UpperCamelCase__			):
						return n
			while n % 2 == 0:
						n //= 2
			if is_prime(UpperCamelCase__			):
						return n
			for i in range(3      ,      int(math.sqrt(UpperCamelCase__			)			) + 1      ,      2			):
						if n % i == 0:
									if is_prime(n // i			):
												UpperCAmelCase       		=    n // i
												break
									elif is_prime(UpperCamelCase__			):
												UpperCAmelCase       		=    i
			return max_number


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



