


from __future__ import annotations

import math
from itertools import permutations






def 		lowercase_(  SCREAMING_SNAKE_CASE_     ):


  '''simple docstring'''

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






def 		lowercase_(  SCREAMING_SNAKE_CASE_ = 7     ):


  '''simple docstring'''

  lowerCamelCase			: int   =    "".join(str(_UpperCamelCase     ) for i in range(1				,						n + 1     )     )
  lowerCamelCase			: List[str]   =    [int("".join(_UpperCamelCase     )     ) for i in permutations(_UpperCamelCase				,						_UpperCamelCase     )]
  lowerCamelCase			: Dict   =    [num for num in perm_list if is_prime(_UpperCamelCase     )]
  return max(_UpperCamelCase     ) if pandigitals else 0


if __name__ == "__main__":
   print(f'''{solution() = }''')







import unittest
from pathlib import Path

from transformers import is_vision_available, load_tool
from transformers.testing_utils import get_tests_dir

from .test_tools_common import ToolTesterMixin


if is_vision_available():
   from PIL import Image
class      UpperCAmelCase_ ( unittest.TestCase		,			UpperCamelCase   ):

   '''simple docstring'''




   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: List[Any]   =    load_tool("image-segmentation"			)
     self.tool.setup()
     lowerCamelCase			: Optional[Any]   =    load_tool("image-segmentation"						,    remote=__A			)






   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: List[str]   =    Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"			)			) / "000000039769.png"			)
     lowerCamelCase			: Dict   =    self.tool(__A						,    "cat"			)
     self.assertTrue(isinstance(__A						,    Image.Image			)			)






   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: int   =    Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"			)			) / "000000039769.png"			)
     lowerCamelCase			: int   =    self.remote_tool(__A						,    "cat"			)
     self.assertTrue(isinstance(__A						,    Image.Image			)			)






   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: Optional[int]   =    Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"			)			) / "000000039769.png"			)
     lowerCamelCase			: Optional[Any]   =    self.tool(image=__A						,    label="cat"			)
     self.assertTrue(isinstance(__A						,    Image.Image			)			)






   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: str   =    Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"			)			) / "000000039769.png"			)
     lowerCamelCase			: Dict   =    self.remote_tool(image=__A						,    label="cat"			)
     self.assertTrue(isinstance(__A						,    Image.Image			)			)



