from unittest import TestCase

from datasets import Sequence, Value
from datasets.arrow_dataset import Dataset




class 					_UpperCAmelCase			(     lowerCAmelCase  ):



 '''simple docstring'''




 def 		__UpperCAmelCase				(		self				:   Dict)						->	str:


   """simple docstring"""







   return [
       {"col_1": 3, "col_2": "a"},
       {"col_1": 2, "col_2": "b"},
       {"col_1": 1, "col_2": "c"},
       {"col_1": 0, "col_2": "d"},
   ]







 def 		__UpperCAmelCase				(		self				:   Union[str, Any])						->	Optional[int]:


   """simple docstring"""







   _UpperCamelCase           =    {"col_1": [3, 2, 1, 0], "col_2": ["a", "b", "c", "d"]}
   return Dataset.from_dict(lowercase_)







 def 		__UpperCAmelCase				(		self				:   str)						->	Dict:


   """simple docstring"""







   _UpperCamelCase           =    self._create_example_records()
   _UpperCamelCase           =    Dataset.from_list(lowercase_)
   self.assertListEqual(dset.column_names							, ["col_1", "col_2"])
   for i, r in enumerate(lowercase_):
     self.assertDictEqual(lowercase_							, example_records[i])







 def 		__UpperCAmelCase				(		self				:   List[str])						->	int:


   """simple docstring"""







   _UpperCamelCase           =    self._create_example_records()
   _UpperCamelCase           =    Dataset.from_list(lowercase_)
   _UpperCamelCase           =    Dataset.from_dict({k: [r[k] for r in example_records] for k in example_records[0]})
   self.assertEqual(dset.info							, dset_from_dict.info)







 def 		__UpperCAmelCase				(		self				:   Any)						->	str:  # checks what happens with missing columns


   """simple docstring"""







   _UpperCamelCase           =    [{"col_1": 1}, {"col_2": "x"}]
   _UpperCamelCase           =    Dataset.from_list(lowercase_)
   self.assertDictEqual(dset[0]							, {"col_1": 1})
   self.assertDictEqual(dset[1]							, {"col_1": None})  # NB: first record is used for columns







 def 		__UpperCAmelCase				(		self				:   Union[str, Any])						->	Optional[Any]:  # checks if the type can be inferred from the second record


   """simple docstring"""







   _UpperCamelCase           =    [{"col_1": []}, {"col_1": [1, 2]}]
   _UpperCamelCase           =    Dataset.from_list(lowercase_)
   self.assertEqual(dset.info.features["col_1"]							, Sequence(Value("int64")))







 def 		__UpperCAmelCase				(		self				:   Any)						->	Tuple:


   """simple docstring"""







   _UpperCamelCase           =    Dataset.from_list([])
   self.assertEqual(len(lowercase_)							, 0)
   self.assertListEqual(dset.column_names							, [])





from math import isqrt, loga


def 				lowerCAmelCase__       (			a__ )      ->list[int]:




  '''simple docstring'''

  _UpperCamelCase           =    [True] * max_number
  for i in range(2    ,     isqrt(max_number - 1 ) + 1 ):
    if is_prime[i]:
      for j in range(i**2    ,     a__    ,     a__ ):
        _UpperCamelCase           =    False

  return [i for i in range(2    ,     a__ ) if is_prime[i]]


def 				lowerCAmelCase__       (			a__ = 800_800    ,     a__ = 800_800 )      ->int:




  '''simple docstring'''

  _UpperCamelCase           =    degree * loga(a__ )
  _UpperCamelCase           =    int(a__ )
  _UpperCamelCase           =    calculate_prime_numbers(a__ )

  _UpperCamelCase           =    0
  _UpperCamelCase           =    0
  _UpperCamelCase           =    len(a__ ) - 1
  while left < right:
    while (
        prime_numbers[right] * loga(prime_numbers[left] )
        + prime_numbers[left] * loga(prime_numbers[right] )
        > upper_bound
    ):
      right -= 1
    hybrid_integers_count += right - left
    left += 1

  return hybrid_integers_count


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




