


import json
import pathlib
import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision, slow
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
   import torch

if is_vision_available():
   from PIL import Image

   from transformers import YolosImageProcessor
class 				SCREAMING_SNAKE_CASE__						(       unittest.TestCase    ):
      def __init__( self       : List[str]  ,							SCREAMING_SNAKE_CASE__       : List[str]  ,							SCREAMING_SNAKE_CASE__       : Tuple=7  ,							SCREAMING_SNAKE_CASE__       : str=3  ,							SCREAMING_SNAKE_CASE__       : Dict=3_0  ,							SCREAMING_SNAKE_CASE__       : Union[str, Any]=4_0_0  ,							SCREAMING_SNAKE_CASE__       : List[str]=True  ,							SCREAMING_SNAKE_CASE__       : Optional[int]=None  ,							SCREAMING_SNAKE_CASE__       : Optional[int]=True  ,							SCREAMING_SNAKE_CASE__       : Dict=[0.5, 0.5, 0.5]  ,							SCREAMING_SNAKE_CASE__       : Any=[0.5, 0.5, 0.5]  ,							SCREAMING_SNAKE_CASE__       : List[Any]=True  ,							SCREAMING_SNAKE_CASE__       : Optional[Any]=1 / 2_5_5  ,							SCREAMING_SNAKE_CASE__       : List[Any]=True  ,							)	->    List[str]:
             # by setting size["longest_edge"] > max_resolution we're effectively not testing this :p
             a_      :	Optional[int]							=						size if size is not None else {'shortest_edge': 1_8, 'longest_edge': 1_3_3_3}
             a_      :	Union[str, Any]							=						parent
             a_      :	Optional[Any]							=						batch_size
             a_      :	Tuple							=						num_channels
             a_      :	List[Any]							=						min_resolution
             a_      :	Any							=						max_resolution
             a_      :	str							=						do_resize
             a_      :	str							=						size
             a_      :	str							=						do_normalize
             a_      :	Tuple							=						image_mean
             a_      :	Union[str, Any]							=						image_std
             a_      :	Tuple							=						do_rescale
             a_      :	List[Any]							=						rescale_factor
             a_      :	List[str]							=						do_pad
      def  SCREAMING_SNAKE_CASE							( self       : int  )	->    List[Any]:
             return {
                 "do_resize": self.do_resize,
                 "size": self.size,
                 "do_normalize": self.do_normalize,
                 "image_mean": self.image_mean,
                 "image_std": self.image_std,
                 "do_rescale": self.do_rescale,
                 "rescale_factor": self.rescale_factor,
                 "do_pad": self.do_pad,
             }

      def  SCREAMING_SNAKE_CASE							( self       : Union[str, Any]  ,							SCREAMING_SNAKE_CASE__       : Union[str, Any]  ,							SCREAMING_SNAKE_CASE__       : Optional[Any]=False  )	->    Any:
             if not batched:
                    a_      :	str							=						image_inputs[0]
                    if isinstance(SCREAMING_SNAKE_CASE__  ,							Image.Image  ):
                           a_      :	List[Any]							=						image.size
                    else:
                           a_      :	Union[str, Any]							=						image.shape[1], image.shape[2]
                    if w < h:
                           a_      :	List[str]							=						int(self.size['shortest_edge'] * h / w  )
                           a_      :	str							=						self.size['shortest_edge']
                    elif w > h:
                           a_      :	Optional[Any]							=						self.size['shortest_edge']
                           a_      :	str							=						int(self.size['shortest_edge'] * w / h  )
                    else:
                           a_      :	List[str]							=						self.size['shortest_edge']
                           a_      :	Union[str, Any]							=						self.size['shortest_edge']

             else:
                    a_      :	Dict							=						[]
                    for image in image_inputs:
                           a_      :	int							=						self.get_expected_values([image]  )
                           expected_values.append((expected_height, expected_width)  )
                    a_      :	Optional[int]							=						max(SCREAMING_SNAKE_CASE__  ,							key=lambda SCREAMING_SNAKE_CASE__  : item[0]  )[0]
                    a_      :	Optional[int]							=						max(SCREAMING_SNAKE_CASE__  ,							key=lambda SCREAMING_SNAKE_CASE__  : item[1]  )[1]

             return expected_height, expected_width
@require_torch
@require_vision
class 				SCREAMING_SNAKE_CASE__						(       lowercase__		,					unittest.TestCase    ):
      snake_case__       :  Union[str, Any]       =		YolosImageProcessor if is_vision_available() else None
      def  SCREAMING_SNAKE_CASE							( self       : List[Any]  )	->    int:
             a_      :	int							=						YolosImageProcessingTester(self  )
      @property
      def  SCREAMING_SNAKE_CASE							( self       : int  )	->    Dict:
             return self.image_processor_tester.prepare_image_processor_dict()
      def  SCREAMING_SNAKE_CASE							( self       : Any  )	->    Tuple:
             a_      :	Dict							=						self.image_processing_class(**self.image_processor_dict  )
             self.assertTrue(hasattr(SCREAMING_SNAKE_CASE__  ,							'image_mean'  )  )
             self.assertTrue(hasattr(SCREAMING_SNAKE_CASE__  ,							'image_std'  )  )
             self.assertTrue(hasattr(SCREAMING_SNAKE_CASE__  ,							'do_normalize'  )  )
             self.assertTrue(hasattr(SCREAMING_SNAKE_CASE__  ,							'do_resize'  )  )
             self.assertTrue(hasattr(SCREAMING_SNAKE_CASE__  ,							'size'  )  )
      def  SCREAMING_SNAKE_CASE							( self       : Optional[Any]  )	->    List[Any]:
             a_      :	Tuple							=						self.image_processing_class.from_dict(self.image_processor_dict  )
             self.assertEqual(image_processor.size  ,							{'shortest_edge': 1_8, 'longest_edge': 1_3_3_3}  )
             self.assertEqual(image_processor.do_pad  ,							SCREAMING_SNAKE_CASE__  )

             a_      :	Union[str, Any]							=						self.image_processing_class.from_dict(
                 self.image_processor_dict  ,							size=4_2  ,							max_size=8_4  ,							pad_and_return_pixel_mask=SCREAMING_SNAKE_CASE__  )
             self.assertEqual(image_processor.size  ,							{'shortest_edge': 4_2, 'longest_edge': 8_4}  )
             self.assertEqual(image_processor.do_pad  ,							SCREAMING_SNAKE_CASE__  )
      def  SCREAMING_SNAKE_CASE							( self       : str  )	->    Optional[int]:
             pass
      def  SCREAMING_SNAKE_CASE							( self       : Optional[Any]  )	->    int:
             # Initialize image_processing
             a_      :	List[Any]							=						self.image_processing_class(**self.image_processor_dict  )
             # create random PIL images
             a_      :	str							=						prepare_image_inputs(self.image_processor_tester  ,							equal_resolution=SCREAMING_SNAKE_CASE__  )
             for image in image_inputs:
                    self.assertIsInstance(SCREAMING_SNAKE_CASE__  ,							Image.Image  )

             # Test not batched input
             a_      :	int							=						image_processing(image_inputs[0]  ,							return_tensors='pt'  ).pixel_values

             a_      :	Optional[Any]							=						self.image_processor_tester.get_expected_values(SCREAMING_SNAKE_CASE__  )

             self.assertEqual(
                 encoded_images.shape  ,							(1, self.image_processor_tester.num_channels, expected_height, expected_width)  ,							)

             # Test batched
             a_      :	Union[str, Any]							=						self.image_processor_tester.get_expected_values(SCREAMING_SNAKE_CASE__  ,							batched=SCREAMING_SNAKE_CASE__  )

             a_      :	Tuple							=						image_processing(SCREAMING_SNAKE_CASE__  ,							return_tensors='pt'  ).pixel_values
             self.assertEqual(
                 encoded_images.shape  ,							(
                     self.image_processor_tester.batch_size,
                     self.image_processor_tester.num_channels,
                     expected_height,
                     expected_width,
                 )  ,							)
      def  SCREAMING_SNAKE_CASE							( self       : List[str]  )	->    Any:
             # Initialize image_processing
             a_      :	str							=						self.image_processing_class(**self.image_processor_dict  )
             # create random numpy tensors
             a_      :	Union[str, Any]							=						prepare_image_inputs(self.image_processor_tester  ,							equal_resolution=SCREAMING_SNAKE_CASE__  ,							numpify=SCREAMING_SNAKE_CASE__  )
             for image in image_inputs:
                    self.assertIsInstance(SCREAMING_SNAKE_CASE__  ,							np.ndarray  )

             # Test not batched input
             a_      :	List[str]							=						image_processing(image_inputs[0]  ,							return_tensors='pt'  ).pixel_values

             a_      :	int							=						self.image_processor_tester.get_expected_values(SCREAMING_SNAKE_CASE__  )

             self.assertEqual(
                 encoded_images.shape  ,							(1, self.image_processor_tester.num_channels, expected_height, expected_width)  ,							)

             # Test batched
             a_      :	int							=						image_processing(SCREAMING_SNAKE_CASE__  ,							return_tensors='pt'  ).pixel_values

             a_      :	int							=						self.image_processor_tester.get_expected_values(SCREAMING_SNAKE_CASE__  ,							batched=SCREAMING_SNAKE_CASE__  )

             self.assertEqual(
                 encoded_images.shape  ,							(
                     self.image_processor_tester.batch_size,
                     self.image_processor_tester.num_channels,
                     expected_height,
                     expected_width,
                 )  ,							)
      def  SCREAMING_SNAKE_CASE							( self       : str  )	->    int:
             # Initialize image_processing
             a_      :	Dict							=						self.image_processing_class(**self.image_processor_dict  )
             # create random PyTorch tensors
             a_      :	int							=						prepare_image_inputs(self.image_processor_tester  ,							equal_resolution=SCREAMING_SNAKE_CASE__  ,							torchify=SCREAMING_SNAKE_CASE__  )
             for image in image_inputs:
                    self.assertIsInstance(SCREAMING_SNAKE_CASE__  ,							torch.Tensor  )

             # Test not batched input
             a_      :	List[str]							=						image_processing(image_inputs[0]  ,							return_tensors='pt'  ).pixel_values

             a_      :	int							=						self.image_processor_tester.get_expected_values(SCREAMING_SNAKE_CASE__  )

             self.assertEqual(
                 encoded_images.shape  ,							(1, self.image_processor_tester.num_channels, expected_height, expected_width)  ,							)

             # Test batched
             a_      :	Tuple							=						image_processing(SCREAMING_SNAKE_CASE__  ,							return_tensors='pt'  ).pixel_values

             a_      :	List[Any]							=						self.image_processor_tester.get_expected_values(SCREAMING_SNAKE_CASE__  ,							batched=SCREAMING_SNAKE_CASE__  )

             self.assertEqual(
                 encoded_images.shape  ,							(
                     self.image_processor_tester.batch_size,
                     self.image_processor_tester.num_channels,
                     expected_height,
                     expected_width,
                 )  ,							)
      def  SCREAMING_SNAKE_CASE							( self       : Any  )	->    str:
             # Initialize image_processings
             a_      :	List[str]							=						self.image_processing_class(**self.image_processor_dict  )
             a_      :	Optional[int]							=						self.image_processing_class(do_resize=SCREAMING_SNAKE_CASE__  ,							do_normalize=SCREAMING_SNAKE_CASE__  ,							do_rescale=SCREAMING_SNAKE_CASE__  )
             # create random PyTorch tensors
             a_      :	List[Any]							=						prepare_image_inputs(self.image_processor_tester  ,							equal_resolution=SCREAMING_SNAKE_CASE__  ,							torchify=SCREAMING_SNAKE_CASE__  )
             for image in image_inputs:
                    self.assertIsInstance(SCREAMING_SNAKE_CASE__  ,							torch.Tensor  )

             # Test whether the method "pad" and calling the image processor return the same tensors
             a_      :	Optional[Any]							=						image_processing_a.pad(SCREAMING_SNAKE_CASE__  ,							return_tensors='pt'  )
             a_      :	Optional[Any]							=						image_processing_a(SCREAMING_SNAKE_CASE__  ,							return_tensors='pt'  )

             self.assertTrue(
                 torch.allclose(encoded_images_with_method['pixel_values']  ,							encoded_images['pixel_values']  ,							atol=1E-4  )  )
      @slow
      def  SCREAMING_SNAKE_CASE							( self       : Union[str, Any]  )	->    Union[str, Any]:
             # prepare image and target
             a_      :	Any							=						Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'  )
             with open('./tests/fixtures/tests_samples/COCO/coco_annotations.txt'  ,							'r'  ) as f:
                    a_      :	Optional[Any]							=						json.loads(f.read()  )

             a_      :	Tuple							=						{'image_id': 3_9_7_6_9, 'annotations': target}

             # encode them
             a_      :	Union[str, Any]							=						YolosImageProcessor.from_pretrained('hustvl/yolos-small'  )
             a_      :	Dict							=						image_processing(images=SCREAMING_SNAKE_CASE__  ,							annotations=SCREAMING_SNAKE_CASE__  ,							return_tensors='pt'  )

             # verify pixel values
             a_      :	List[Any]							=						torch.Size([1, 3, 8_0_0, 1_0_6_6]  )
             self.assertEqual(encoding['pixel_values'].shape  ,							SCREAMING_SNAKE_CASE__  )

             a_      :	Tuple							=						torch.tensor([0.2796, 0.3138, 0.3481]  )
             self.assertTrue(torch.allclose(encoding['pixel_values'][0, 0, 0, :3]  ,							SCREAMING_SNAKE_CASE__  ,							atol=1E-4  )  )

             # verify area
             a_      :	List[str]							=						torch.tensor([5887.9600, 11250.2061, 489353.8438, 837122.7500, 147967.5156, 165732.3438]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['area']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify boxes
             a_      :	List[Any]							=						torch.Size([6, 4]  )
             self.assertEqual(encoding['labels'][0]['boxes'].shape  ,							SCREAMING_SNAKE_CASE__  )
             a_      :	Tuple							=						torch.tensor([0.5503, 0.2765, 0.0604, 0.2215]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['boxes'][0]  ,							SCREAMING_SNAKE_CASE__  ,							atol=1E-3  )  )
             # verify image_id
             a_      :	Optional[int]							=						torch.tensor([3_9_7_6_9]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['image_id']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify is_crowd
             a_      :	Dict							=						torch.tensor([0, 0, 0, 0, 0, 0]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['iscrowd']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify class_labels
             a_      :	List[Any]							=						torch.tensor([7_5, 7_5, 6_3, 6_5, 1_7, 1_7]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['class_labels']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify orig_size
             a_      :	Union[str, Any]							=						torch.tensor([4_8_0, 6_4_0]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['orig_size']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify size
             a_      :	Optional[int]							=						torch.tensor([8_0_0, 1_0_6_6]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['size']  ,							SCREAMING_SNAKE_CASE__  )  )

      @slow
      def  SCREAMING_SNAKE_CASE							( self       : List[Any]  )	->    Optional[Any]:
             # prepare image, target and masks_path
             a_      :	Any							=						Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'  )
             with open('./tests/fixtures/tests_samples/COCO/coco_panoptic_annotations.txt'  ,							'r'  ) as f:
                    a_      :	Dict							=						json.loads(f.read()  )

             a_      :	Optional[int]							=						{'file_name': '000000039769.png', 'image_id': 3_9_7_6_9, 'segments_info': target}

             a_      :	Tuple							=						pathlib.Path('./tests/fixtures/tests_samples/COCO/coco_panoptic'  )

             # encode them
             a_      :	int							=						YolosImageProcessor(format='coco_panoptic'  )
             a_      :	List[str]							=						image_processing(images=SCREAMING_SNAKE_CASE__  ,							annotations=SCREAMING_SNAKE_CASE__  ,							masks_path=SCREAMING_SNAKE_CASE__  ,							return_tensors='pt'  )

             # verify pixel values
             a_      :	Dict							=						torch.Size([1, 3, 8_0_0, 1_0_6_6]  )
             self.assertEqual(encoding['pixel_values'].shape  ,							SCREAMING_SNAKE_CASE__  )

             a_      :	Optional[int]							=						torch.tensor([0.2796, 0.3138, 0.3481]  )
             self.assertTrue(torch.allclose(encoding['pixel_values'][0, 0, 0, :3]  ,							SCREAMING_SNAKE_CASE__  ,							atol=1E-4  )  )

             # verify area
             a_      :	int							=						torch.tensor([147979.6875, 165527.0469, 484638.5938, 11292.9375, 5879.6562, 7634.1147]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['area']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify boxes
             a_      :	Optional[int]							=						torch.Size([6, 4]  )
             self.assertEqual(encoding['labels'][0]['boxes'].shape  ,							SCREAMING_SNAKE_CASE__  )
             a_      :	int							=						torch.tensor([0.2625, 0.5437, 0.4688, 0.8625]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['boxes'][0]  ,							SCREAMING_SNAKE_CASE__  ,							atol=1E-3  )  )
             # verify image_id
             a_      :	Any							=						torch.tensor([3_9_7_6_9]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['image_id']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify is_crowd
             a_      :	Any							=						torch.tensor([0, 0, 0, 0, 0, 0]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['iscrowd']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify class_labels
             a_      :	List[str]							=						torch.tensor([1_7, 1_7, 6_3, 7_5, 7_5, 9_3]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['class_labels']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify masks
             a_      :	Optional[int]							=						8_2_2_8_7_3
             self.assertEqual(encoding['labels'][0]['masks'].sum().item()  ,							SCREAMING_SNAKE_CASE__  )
             # verify orig_size
             a_      :	Tuple							=						torch.tensor([4_8_0, 6_4_0]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['orig_size']  ,							SCREAMING_SNAKE_CASE__  )  )
             # verify size
             a_      :	str							=						torch.tensor([8_0_0, 1_0_6_6]  )
             self.assertTrue(torch.allclose(encoding['labels'][0]['size']  ,							SCREAMING_SNAKE_CASE__  )  )






# This code is adapted from OpenAI's release
# https://github.com/openai/human-eval/blob/master/human_eval/execution.py

import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import tempfile







def  SCREAMING_SNAKE_CASE_		(    __A				:    List[Any]						,					__A				:    List[Any]						,					__A				:    List[Any]						,					__A				:    Optional[int]       )			->	Dict:

       """simple docstring"""

       a_      :	Optional[Any]							=						multiprocessing.Manager()
       a_      :	Tuple							=						manager.list()

       a_      :	Optional[int]							=						multiprocessing.Process(target=__A						,					args=(check_program, result, timeout)       )
       p.start()
       p.join(timeout=timeout + 1       )
       if p.is_alive():
              p.kill()

       if not result:
              result.append('timed out'       )

       return {
           "task_id": task_id,
           "passed": result[0] == "passed",
           "result": result[0],
           "completion_id": completion_id,
       }







def  SCREAMING_SNAKE_CASE_		(    __A				:    Tuple						,					__A				:    Optional[Any]						,					__A				:    Optional[Any]       )			->	Dict:

       """simple docstring"""

       with create_tempdir():
              # These system calls are needed when cleaning up tempdir.
              import os
              import shutil

              a_      :	Any							=						shutil.rmtree
              a_      :	List[str]							=						os.rmdir
              a_      :	List[Any]							=						os.chdir

              # Disable functionalities that can make destructive changes to the test.
              reliability_guard()

              # Run program.
              try:
                     a_      :	Any							=						{}
                     with swallow_io():
                            with time_limit(__A       ):
                                   exec(__A						,					__A       )
                     result.append('passed'       )
              except TimeoutException:
                     result.append('timed out'       )
              except BaseException as e:
                     result.append(F"""failed: {e}"""       )

              # Needed for cleaning up.
              a_      :	Tuple							=						rmtree
              a_      :	Any							=						rmdir
              a_      :	Optional[int]							=						chdir







@contextlib.contextmanager
def  SCREAMING_SNAKE_CASE_		(    __A				:    List[str]       )			->	str:

       """simple docstring"""

       def signal_handler(__A				:    List[str]						,					__A				:    Dict       ):
              raise TimeoutException('Timed out!'       )

       signal.setitimer(signal.ITIMER_REAL						,					__A       )
       signal.signal(signal.SIGALRM						,					__A       )
       try:
              yield
       finally:
              signal.setitimer(signal.ITIMER_REAL						,					0       )







@contextlib.contextmanager
def  SCREAMING_SNAKE_CASE_		(    )			->	Dict:

       """simple docstring"""

       a_      :	int							=						WriteOnlyStringIO()
       with contextlib.redirect_stdout(__A       ):
              with contextlib.redirect_stderr(__A       ):
                     with redirect_stdin(__A       ):
                            yield







@contextlib.contextmanager
def  SCREAMING_SNAKE_CASE_		(    )			->	Optional[int]:

       """simple docstring"""

       with tempfile.TemporaryDirectory() as dirname:
              with chdir(__A       ):
                     yield dirname
class 				SCREAMING_SNAKE_CASE__						(       lowercase__    ):
      pass
class 				SCREAMING_SNAKE_CASE__						(       io.StringIO    ):
      def  SCREAMING_SNAKE_CASE							( self       : List[Any]  ,							*SCREAMING_SNAKE_CASE__       : List[str]  ,							**SCREAMING_SNAKE_CASE__       : List[Any]  )	->    int:
             raise OSError
      def  SCREAMING_SNAKE_CASE							( self       : Tuple  ,							*SCREAMING_SNAKE_CASE__       : Tuple  ,							**SCREAMING_SNAKE_CASE__       : Dict  )	->    List[str]:
             raise OSError
      def  SCREAMING_SNAKE_CASE							( self       : int  ,							*SCREAMING_SNAKE_CASE__       : Dict  ,							**SCREAMING_SNAKE_CASE__       : List[Any]  )	->    Optional[Any]:
             raise OSError

      def  SCREAMING_SNAKE_CASE							( self       : Any  ,							*SCREAMING_SNAKE_CASE__       : Union[str, Any]  ,							**SCREAMING_SNAKE_CASE__       : List[Any]  )	->    List[Any]:
             return False
class 				SCREAMING_SNAKE_CASE__						(       contextlib._RedirectStream    ):  # type: ignore
      snake_case__       :  Optional[int]       =		'''stdin'''







@contextlib.contextmanager
def  SCREAMING_SNAKE_CASE_		(    __A				:    Tuple       )			->	Union[str, Any]:

       """simple docstring"""

       if root == ".":
              yield
              return
       a_      :	str							=						os.getcwd()
       os.chdir(__A       )
       try:
              yield
       except BaseException as exc:
              raise exc
       finally:
              os.chdir(__A       )







def  SCREAMING_SNAKE_CASE_		(    __A				:    Dict=None       )			->	Dict:

       """simple docstring"""

       if maximum_memory_bytes is not None:
              import resource

              resource.setrlimit(resource.RLIMIT_AS						,					(maximum_memory_bytes, maximum_memory_bytes)       )
              resource.setrlimit(resource.RLIMIT_DATA						,					(maximum_memory_bytes, maximum_memory_bytes)       )
              if not platform.uname().system == "Darwin":
                     resource.setrlimit(resource.RLIMIT_STACK						,					(maximum_memory_bytes, maximum_memory_bytes)       )

       faulthandler.disable()

       import builtins

       a_      :	str							=						None
       a_      :	str							=						None

       import os

       a_      :	Optional[int]							=						'1'

       a_      :	Any							=						None
       a_      :	int							=						None
       a_      :	int							=						None
       a_      :	Tuple							=						None
       a_      :	Dict							=						None
       a_      :	Any							=						None
       a_      :	Dict							=						None
       a_      :	Dict							=						None
       a_      :	List[str]							=						None
       a_      :	Optional[Any]							=						None
       a_      :	Tuple							=						None
       a_      :	Union[str, Any]							=						None
       a_      :	Dict							=						None
       a_      :	Dict							=						None
       a_      :	int							=						None
       a_      :	str							=						None
       a_      :	Union[str, Any]							=						None
       a_      :	str							=						None
       a_      :	Optional[int]							=						None
       a_      :	List[Any]							=						None
       a_      :	Union[str, Any]							=						None
       a_      :	Dict							=						None
       a_      :	Tuple							=						None
       a_      :	List[str]							=						None
       a_      :	str							=						None
       a_      :	str							=						None
       a_      :	str							=						None

       import shutil

       a_      :	Dict							=						None
       a_      :	Tuple							=						None
       a_      :	str							=						None

       import subprocess

       a_      :	str							=						None  # type: ignore

       a_      :	List[Any]							=						None

       import sys

       a_      :	Optional[int]							=						None
       a_      :	int							=						None
       a_      :	Any							=						None
       a_      :	str							=						None
       a_      :	str							=						None


