

'''simple docstring'''







import unittest

import numpy as np
import torch

from .utils_summarization import build_mask, compute_token_type_ids, process_story, truncate_or_pad


class 					A__      (      unittest.TestCase			):



    def 					snake_case_			(					self       )						->      int:





           '''simple docstring'''
           A_						=      10



    def 					snake_case_			(					self       )						->      List[Any]:





           '''simple docstring'''
           A_						=      [1, 2, 3, 4]
           A_						=      [1, 2, 3, 4, 0, 0, 0, 0, 0, 0]
           self.assertEqual(truncate_or_pad(_A		,				self.block_size		,				0       )		,				_A       )



    def 					snake_case_			(					self       )						->      int:





           '''simple docstring'''
           A_						=      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
           A_						=      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
           self.assertEqual(truncate_or_pad(_A		,				self.block_size		,				0       )		,				_A       )



    def 					snake_case_			(					self       )						->      List[Any]:





           '''simple docstring'''
           A_						=      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
           A_						=      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
           self.assertEqual(truncate_or_pad(_A		,				self.block_size		,				0       )		,				_A       )



    def 					snake_case_			(					self       )						->      List[Any]:





           '''simple docstring'''
           A_						=      'It was the year of Our Lord one thousand seven hundred and\n        seventy-five.\n\nSpiritual revelations were conceded to England at that\n        favoured period, as at this.'
           A_						=      process_story(_A       )
           self.assertEqual(_A		,				[]       )



    def 					snake_case_			(					self       )						->      Optional[Any]:





           '''simple docstring'''
           A_						=      ''
           A_						=      process_story(_A       )
           self.assertEqual(_A		,				[]       )
           self.assertEqual(_A		,				[]       )



    def 					snake_case_			(					self       )						->      Optional[Any]:





           '''simple docstring'''
           A_						=      (
               'It was the year of Our Lord one thousand seven hundred and '
               'seventy-five\n\nSpiritual revelations were conceded to England '
               'at that favoured period, as at this.\n@highlight\n\nIt was the best of times'
           )
           A_						=      process_story(_A       )

           A_						=      [
               'It was the year of Our Lord one thousand seven hundred and seventy-five.',
               'Spiritual revelations were conceded to England at that favoured period, as at this.',
           ]
           self.assertEqual(_A		,				_A       )

           A_						=      ['It was the best of times.']
           self.assertEqual(_A		,				_A       )



    def 					snake_case_			(					self       )						->      Optional[Any]:





           '''simple docstring'''
           A_						=      torch.tensor([1, 2, 3, 4]       )
           A_						=      torch.tensor([1, 1, 1, 1]       )
           np.testing.assert_array_equal(build_mask(_A		,				0       ).numpy()		,				expected.numpy()       )



    def 					snake_case_			(					self       )						->      Union[str, Any]:





           '''simple docstring'''
           A_						=      torch.tensor([1, 2, 3, 4, 23, 23, 23]       )
           A_						=      torch.tensor([1, 1, 1, 1, 0, 0, 0]       )
           np.testing.assert_array_equal(build_mask(_A		,				23       ).numpy()		,				expected.numpy()       )



    def 					snake_case_			(					self       )						->      Union[str, Any]:





           '''simple docstring'''
           A_						=      torch.tensor([8, 2, 3, 4, 1, 1, 1]       )
           A_						=      torch.tensor([1, 1, 1, 1, 0, 0, 0]       )
           np.testing.assert_array_equal(build_mask(_A		,				1       ).numpy()		,				expected.numpy()       )







    def 					snake_case_			(					self       )						->      int:





           '''simple docstring'''
           A_						=      101
           A_						=      torch.tensor([[1, 2, 3, 4, 5, 6], [1, 2, 3, 101, 5, 6], [1, 101, 3, 4, 101, 6]]       )
           A_						=      torch.tensor([[1, 1, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1]]       )

           A_						=      compute_token_type_ids(_A		,				_A       )
           np.testing.assert_array_equal(_A		,				_A       )



'''simple docstring'''







from __future__ import annotations

import math
def       UpperCAmelCase__    (      UpperCAmelCase__				)			->			bool:

       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


__lowerCamelCase		       =    [num for num in range(3, 10_0001, 2) if not is_prime(num)]
def       UpperCAmelCase__    (      UpperCAmelCase__				)			->			list[int]:
       if not isinstance(UpperCAmelCase__,       UpperCAmelCase__				):
              raise ValueError("""n must be an integer"""				)
       if n <= 0:
              raise ValueError("""n must be >= 0"""				)

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

       return []
def       UpperCAmelCase__    (      )			->			int:
       return compute_nums(1				)[0]


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