

def    __lowerCamelCase      (					UpperCamelCase__ ):







							'''simple docstring'''






							return "".join(chr(ord(UpperCamelCase__ ) - 32 ) if 'a' <= char <= 'z' else char for char in word )


if __name__ == "__main__":
					from doctest import testmod

					testmod()







import unittest

import numpy as np
import torch

from .utils_summarization import build_mask, compute_token_type_ids, process_story, truncate_or_pad







class 					lowercase							(			unittest.TestCase     ):




				def        a				(   self			):
											snake_case_     							=       10




				def        a				(   self			):
											snake_case_     							=       [1, 2, 3, 4]
											snake_case_     							=       [1, 2, 3, 4, 0, 0, 0, 0, 0, 0]
											self.assertEqual(truncate_or_pad(snake_case ,  self.block_size ,  0			) ,  snake_case			)




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




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




				def        a				(   self			):
											snake_case_     							=       '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.'
											snake_case_							,       snake_case_     							=       process_story(snake_case			)
											self.assertEqual(snake_case ,  []			)




				def        a				(   self			):
											snake_case_     							=       ''
											snake_case_							,       snake_case_     							=       process_story(snake_case			)
											self.assertEqual(snake_case ,  []			)
											self.assertEqual(snake_case ,  []			)




				def        a				(   self			):
											snake_case_     							=       (
											    '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'
											)
											snake_case_							,       snake_case_     							=       process_story(snake_case			)

											snake_case_     							=       [
											    '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(snake_case ,  snake_case			)

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




				def        a				(   self			):
											snake_case_     							=       torch.tensor([1, 2, 3, 4]			)
											snake_case_     							=       torch.tensor([1, 1, 1, 1]			)
											np.testing.assert_array_equal(build_mask(snake_case ,  0			).numpy() ,  expected.numpy()			)




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




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




				def        a				(   self			):
											snake_case_     							=       101
											snake_case_     							=       torch.tensor([[1, 2, 3, 4, 5, 6], [1, 2, 3, 101, 5, 6], [1, 101, 3, 4, 101, 6]]			)
											snake_case_     							=       torch.tensor([[1, 1, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0], [1, 0, 0, 0, 1, 1]]			)

											snake_case_     							=       compute_token_type_ids(snake_case ,  snake_case			)
											np.testing.assert_array_equal(snake_case ,  snake_case			)




