




'''simple docstring'''





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_		:     str          =		'''sshleifer/bart-tiny-random'''
UpperCamelCase_		:     List[str]          =		'''patrickvonplaten/t5-tiny-random'''

@require_torch
class   _a							(		unittest.TestCase				):






     @cached_property
     def 							_lowercase      (					self       )				->     Tuple:
          return AutoConfig.from_pretrained(_SCREAMING_SNAKE_CASE       )






     def 							_lowercase      (					self       )				->     str:
          _snake_case				,   *_snake_case				= create_student_by_copying_alternating_layers(_SCREAMING_SNAKE_CASE   ,tempfile.mkdtemp()   ,e=1   ,d=1       )
          self.assertEqual(student.config.num_hidden_layers   ,1       )






     def 							_lowercase      (					self       )				->     Tuple:
          _snake_case				,   *_snake_case				= create_student_by_copying_alternating_layers(_SCREAMING_SNAKE_CASE   ,tempfile.mkdtemp()   ,e=1   ,d=_SCREAMING_SNAKE_CASE       )






     def 							_lowercase      (					self       )				->     Any:
          _snake_case				,   *_snake_case				= create_student_by_copying_alternating_layers(_SCREAMING_SNAKE_CASE   ,tempfile.mkdtemp()   ,e=1   ,d=_SCREAMING_SNAKE_CASE       )
          self.assertEqual(student.config.encoder_layers   ,1       )
          self.assertEqual(student.config.decoder_layers   ,self.teacher_config.encoder_layers       )






     def 							_lowercase      (					self       )				->     Union[str, Any]:
          _snake_case				,   *_snake_case				= create_student_by_copying_alternating_layers(_SCREAMING_SNAKE_CASE   ,tempfile.mkdtemp()   ,e=1   ,d=1       )
          self.assertEqual(student.config.encoder_layers   ,1       )
          self.assertEqual(student.config.decoder_layers   ,1       )






     def 							_lowercase      (					self       )				->     List[str]:
          with self.assertRaises(_SCREAMING_SNAKE_CASE       ):
               create_student_by_copying_alternating_layers(_SCREAMING_SNAKE_CASE   ,tempfile.mkdtemp()   ,e=_SCREAMING_SNAKE_CASE   ,d=_SCREAMING_SNAKE_CASE       )








'''simple docstring'''





from math import ceil





def       __a      (  _UpperCamelCase:       int = 1_001       )		->					int:

     """simple docstring"""




     _snake_case				= 1

     for i in range(1   ,		int(ceil(n / 2.0       )       )       ):
          _snake_case				= 2 * i + 1
          _snake_case				= 2 * i
          _snake_case				= total + 4 * odd**2 - 6 * even

     return total


if __name__ == "__main__":
   import sys

   if len(sys.argv) == 1:
      print(solution())
   else:
      try:
         UpperCamelCase_		:     int          =		int(sys.argv[1])
         print(solution(n))
      except ValueError:
         print('''Invalid entry - please enter a number''')


