


import tempfile
import unittest

from make_student import create_student_by_copying_alternating_layers

from transformers import AutoConfig
from transformers.file_utils import cached_property
from transformers.testing_utils import require_torch


__UpperCamelCase    		=       'sshleifer/bart-tiny-random'
__UpperCamelCase    		=       'patrickvonplaten/t5-tiny-random'







@require_torch
class        lowerCamelCase__	(							unittest.TestCase      ):






			"""simple docstring"""






			@cached_property
			def 				snake_case__				(							self     ):

						'''simple docstring'''


						return AutoConfig.from_pretrained(snake_case     )




			def 				snake_case__				(							self     ):

						'''simple docstring'''


						UpperCamelCase__,      *UpperCamelCase__					=       create_student_by_copying_alternating_layers(snake_case      ,						tempfile.mkdtemp()      ,						e=1      ,						d=1     )
						self.assertEqual(student.config.num_hidden_layers      ,						1     )




			def 				snake_case__				(							self     ):

						'''simple docstring'''


						UpperCamelCase__,      *UpperCamelCase__					=       create_student_by_copying_alternating_layers(snake_case      ,						tempfile.mkdtemp()      ,						e=1      ,						d=snake_case     )




			def 				snake_case__				(							self     ):

						'''simple docstring'''


						UpperCamelCase__,      *UpperCamelCase__					=       create_student_by_copying_alternating_layers(snake_case      ,						tempfile.mkdtemp()      ,						e=1      ,						d=snake_case     )
						self.assertEqual(student.config.encoder_layers      ,						1     )
						self.assertEqual(student.config.decoder_layers      ,						self.teacher_config.encoder_layers     )




			def 				snake_case__				(							self     ):

						'''simple docstring'''


						UpperCamelCase__,      *UpperCamelCase__					=       create_student_by_copying_alternating_layers(snake_case      ,						tempfile.mkdtemp()      ,						e=1      ,						d=1     )
						self.assertEqual(student.config.encoder_layers      ,						1     )
						self.assertEqual(student.config.decoder_layers      ,						1     )







			def 				snake_case__				(							self     ):

						'''simple docstring'''


						with self.assertRaises(snake_case     ):
									create_student_by_copying_alternating_layers(snake_case      ,						tempfile.mkdtemp()      ,						e=snake_case      ,						d=snake_case     )






from __future__ import annotations
def        UpperCamelCase_(				_A   :list[int]				,     _A   :int  )->		list[int]:
			UpperCamelCase__					=       0
			UpperCamelCase__					=       len(_A  ) - 1

			while i < j:
						if nums[i] + nums[j] == target:
									return [i, j]
						elif nums[i] + nums[j] < target:
									UpperCamelCase__					=       i + 1
						else:
									UpperCamelCase__					=       j - 1

			return []


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						print(f'''{two_pointer([2, 7, 1_1, 1_5], 9) = }''')


