
"""simple docstring"""





import os
import shutil
import unittest
from unittest.mock import patch

from transformers.testing_utils import CaptureStd, is_pt_tf_cross_test, require_torch


class A_      (unittest.TestCase ):




  '''simple docstring'''







  @patch("sys.argv"							,  ["fakeprogrampath", "env"]    )
  def 			UpperCamelCase__   (						self    ):

     """simple docstring"""
     # test transformers-cli env
     import transformers.commands.transformers_cli

     with CaptureStd() as cs:
        transformers.commands.transformers_cli.main()
     self.assertIn("Python version"							,  cs.out    )
     self.assertIn("Platform"							,  cs.out    )
     self.assertIn("Using distributed or parallel set-up in script?"							,  cs.out    )







  @is_pt_tf_cross_test
  @patch(
      "sys.argv"							,  ["fakeprogrampath", "pt-to-tf", "--model-name", "hf-internal-testing/tiny-random-gptj", "--no-pr"]    )
  def 			UpperCamelCase__   (						self    ):

     """simple docstring"""
     import transformers.commands.transformers_cli

     shutil.rmtree("/tmp/hf-internal-testing/tiny-random-gptj"							,  ignore_errors=UpperCAmelCase_    )  # cleans potential past runs
     transformers.commands.transformers_cli.main()

     # The original repo has no TF weights -- if they exist, they were created by the CLI
     self.assertTrue(os.path.exists("/tmp/hf-internal-testing/tiny-random-gptj/tf_model.h5"    )    )







  @require_torch
  @patch("sys.argv"							,  ["fakeprogrampath", "download", "hf-internal-testing/tiny-random-gptj", "--cache-dir", "/tmp"]    )
  def 			UpperCamelCase__   (						self    ):

     """simple docstring"""
     import transformers.commands.transformers_cli

     # # remove any previously downloaded model to start clean
     shutil.rmtree("/tmp/models--hf-internal-testing--tiny-random-gptj"							,  ignore_errors=UpperCAmelCase_    )

     # run the command
     transformers.commands.transformers_cli.main()

     # check if the model files are downloaded correctly on /tmp/models--hf-internal-testing--tiny-random-gptj
     self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--tiny-random-gptj/blobs"    )    )
     self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--tiny-random-gptj/refs"    )    )
     self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--tiny-random-gptj/snapshots"    )    )







  @require_torch
  @patch(
      "sys.argv"							,  [
          "fakeprogrampath",
          "download",
          "hf-internal-testing/test_dynamic_model_with_tokenizer",
          "--trust-remote-code",
          "--cache-dir",
          "/tmp",
      ]							,  )
  def 			UpperCamelCase__   (						self    ):

     """simple docstring"""
     import transformers.commands.transformers_cli

     # # remove any previously downloaded model to start clean
     shutil.rmtree("/tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer"							,  ignore_errors=UpperCAmelCase_    )

     # run the command
     transformers.commands.transformers_cli.main()

     # check if the model files are downloaded correctly on /tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer
     self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer/blobs"    )    )
     self.assertTrue(os.path.exists("/tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer/refs"    )    )
     self.assertTrue(
         os.path.exists("/tmp/models--hf-internal-testing--test_dynamic_model_with_tokenizer/snapshots"    )    )




"""simple docstring"""

def 						UpperCAmelCase   (						a_     ):





		'''simple docstring'''


		if not isinstance(a_,		a_     ):
				raise TypeError('recursive_lucas_number accepts only integer arguments.'     )
		if n_th_number == 0:
				return 2
		if n_th_number == 1:
				return 1

		return recursive_lucas_number(n_th_number - 1     ) + recursive_lucas_number(
		    n_th_number - 2     )
def 						UpperCAmelCase   (						a_     ):





		'''simple docstring'''


		if not isinstance(a_,		a_     ):
				raise TypeError('dynamic_lucas_number accepts only integer arguments.'     )
		lowerCamelCase      ,       lowerCamelCase	:     Optional[int]            =       2, 1
		for _ in range(a_     ):
				lowerCamelCase      ,       lowerCamelCase	:     Optional[int]            =       b, a + b
		return a


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

					testmod()
					_A				=					int(input('Enter the number of terms in lucas series:\n').strip())
					print('Using recursive function to calculate lucas series:')
					print(' '.join(str(recursive_lucas_number(i)) for i in range(n)))
					print('\nUsing dynamic function to calculate lucas series:')
					print(' '.join(str(dynamic_lucas_number(i)) for i in range(n)))






