
"""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 __lowerCAmelCase						( unittest.TestCase     ):





     @patch('sys.argv'      ,	['fakeprogrampath', 'env'] )
     def 		UpperCAmelCase   (      self ):

      '''simple docstring'''




      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"""

import math
from itertools import permutations






def 				A		(							snake_case :int						) ->      bool:

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






def 				A		(							snake_case :int							,   snake_case :list						) ->      bool:
 __UpperCamelCase    ,      __UpperCamelCase							    =			0, len(snake_case						) - 1
 while left <= right:
  __UpperCamelCase							    =			(left + right) // 2
  if prime_list[middle] == target:
   return True
  elif prime_list[middle] < target:
   __UpperCamelCase							    =			middle + 1
  else:
   __UpperCamelCase							    =			middle - 1

 return False






def 				A		(							) ->      int:
 __UpperCamelCase							    =			[n for n in range(1_0_0_1							,   1_0_0_0_0							,   2						) if is_prime(snake_case						)]
 __UpperCamelCase							    =			[]

 for number in prime_list:
  __UpperCamelCase							    =			[]

  for prime_member in permutations(list(str(snake_case						)						)						):
   __UpperCamelCase							    =			int(''.join(snake_case						)						)

   if prime % 2 == 0:
    continue

   if search(snake_case							,   snake_case						):
    tmp_numbers.append(snake_case						)

  tmp_numbers.sort()
  if len(snake_case						) >= 3:
   candidates.append(snake_case						)

 __UpperCamelCase							    =			[]
 for candidate in candidates:
  __UpperCamelCase							    =			len(snake_case						)
  __UpperCamelCase							    =			False

  for i in range(snake_case						):
   for j in range(i + 1							,   snake_case						):
    for k in range(j + 1							,   snake_case						):
     if (
         abs(candidate[i] - candidate[j]						)
         == abs(candidate[j] - candidate[k]						)
         and len({candidate[i], candidate[j], candidate[k]}						) == 3
     ):
      passed.append(
          sorted([candidate[i], candidate[j], candidate[k]]						)						)
      __UpperCamelCase							    =			True

     if found:
      break
    if found:
     break
   if found:
    break

 __UpperCamelCase							    =			set()
 for seq in passed:
  answer.add(''.join([str(snake_case						) for i in seq]						)						)

 return max(int(snake_case						) for x in answer						)


if __name__ == "__main__":
      print(solution())



