






'''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 		UpperCamelCase__    (unittest.TestCase			):




  '''simple docstring'''





  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  10






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  [1, 2, 3, 4]
        lowerCamelCase__         =  [1, 2, 3, 4, 0, 0, 0, 0, 0, 0]
        self.assertEqual(truncate_or_pad(lowerCAmelCase__   ,self.block_size   ,0       )   ,lowerCAmelCase__       )






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
        lowerCamelCase__         =  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
        self.assertEqual(truncate_or_pad(lowerCAmelCase__   ,self.block_size   ,0       )   ,lowerCAmelCase__       )






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
        lowerCamelCase__         =  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
        self.assertEqual(truncate_or_pad(lowerCAmelCase__   ,self.block_size   ,0       )   ,lowerCAmelCase__       )






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  """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."""
        lowerCamelCase__       ,			lowerCamelCase__         =  process_story(lowerCAmelCase__       )
        self.assertEqual(lowerCAmelCase__   ,[]       )






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  """"""
        lowerCamelCase__       ,			lowerCamelCase__         =  process_story(lowerCAmelCase__       )
        self.assertEqual(lowerCAmelCase__   ,[]       )
        self.assertEqual(lowerCAmelCase__   ,[]       )






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  (
            """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"""
        )
        lowerCamelCase__       ,			lowerCamelCase__         =  process_story(lowerCAmelCase__       )

        lowerCamelCase__         =  [
            """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(lowerCAmelCase__   ,lowerCAmelCase__       )

        lowerCamelCase__         =  ["""It was the best of times."""]
        self.assertEqual(lowerCAmelCase__   ,lowerCAmelCase__       )






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  torch.tensor([1, 2, 3, 4]       )
        lowerCamelCase__         =  torch.tensor([1, 1, 1, 1]       )
        np.testing.assert_array_equal(build_mask(lowerCAmelCase__   ,0       ).numpy()   ,expected.numpy()       )






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  torch.tensor([1, 2, 3, 4, 23, 23, 23]       )
        lowerCamelCase__         =  torch.tensor([1, 1, 1, 1, 0, 0, 0]       )
        np.testing.assert_array_equal(build_mask(lowerCAmelCase__   ,23       ).numpy()   ,expected.numpy()       )






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  torch.tensor([8, 2, 3, 4, 1, 1, 1]       )
        lowerCamelCase__         =  torch.tensor([1, 1, 1, 1, 0, 0, 0]       )
        np.testing.assert_array_equal(build_mask(lowerCAmelCase__   ,1       ).numpy()   ,expected.numpy()       )






  def 			UpperCamelCase_					(      self       ):
        lowerCamelCase__         =  1_01
        lowerCamelCase__         =  torch.tensor([[1, 2, 3, 4, 5, 6], [1, 2, 3, 1_01, 5, 6], [1, 1_01, 3, 4, 1_01, 6]]       )
        lowerCamelCase__         =  torch.tensor([[1, 1, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1]]       )

        lowerCamelCase__         =  compute_token_type_ids(lowerCAmelCase__   ,lowerCAmelCase__       )
        np.testing.assert_array_equal(lowerCAmelCase__   ,lowerCAmelCase__       )









'''simple docstring'''







from __future__ import annotations

import math
def 						A__			(				__lowerCAmelCase		:			int						):

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


UpperCamelCase    :      str  			=		[num for num in range(3, 10_00_01, 2) if not is_prime(num)]
def 						A__			(				__lowerCAmelCase		:			int						):
						if not isinstance(__lowerCAmelCase   ,    __lowerCAmelCase						):
												raise ValueError("""n must be an integer"""						)
						if n <= 0:
												raise ValueError("""n must be >= 0"""						)

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

						return []
def 						A__			(				):
						return compute_nums(1						)[0]


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

