






'''simple docstring'''






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 DetaImageProcessor




class a_    (    unittest.TestCase							):







   def __init__(self					,   __a					,   __a=7					,   __a=3					,   __a=3_0					,   __a=4_0_0					,   __a=True					,   __a=None					,   __a=True					,   __a=[0.5, 0.5, 0.5]					,   __a=[0.5, 0.5, 0.5]					,   __a=True					,   __a=1 / 2_5_5					,   __a=True					,   )			->      Optional[int]:
      """simple docstring"""






      __snake_case				:      Union[str, Any]     							= size if size is not None else {'shortest_edge': 1_8, 'longest_edge': 1_3_3_3}
      __snake_case				:      Tuple     							= parent
      __snake_case				:      Any     							= batch_size
      __snake_case				:      Union[str, Any]     							= num_channels
      __snake_case				:      str     							= min_resolution
      __snake_case				:      Tuple     							= max_resolution
      __snake_case				:      List[str]     							= do_resize
      __snake_case				:      int     							= size
      __snake_case				:      Optional[Any]     							= do_normalize
      __snake_case				:      Any     							= image_mean
      __snake_case				:      Any     							= image_std
      __snake_case				:      Optional[Any]     							= do_rescale
      __snake_case				:      Optional[Any]     							= rescale_factor
      __snake_case				:      List[str]     							= do_pad







   def     SCREAMING_SNAKE_CASE__					(self)			->      Any:
      """simple docstring"""






      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					,   __a					,   __a=False)			->      Any:
      """simple docstring"""






      if not batched:
         __snake_case				:      List[str]     							= image_inputs[0]
         if isinstance(__a					,   Image.Image):
            __snake_case							,__snake_case				:      Tuple     							= image.size
         else:
            __snake_case							,__snake_case				:      str     							= image.shape[1], image.shape[2]
         if w < h:
            __snake_case				:      List[Any]     							= int(self.size['shortest_edge'] * h / w)
            __snake_case				:      List[Any]     							= self.size['shortest_edge']
         elif w > h:
            __snake_case				:      Optional[Any]     							= self.size['shortest_edge']
            __snake_case				:      List[str]     							= int(self.size['shortest_edge'] * w / h)
         else:
            __snake_case				:      Any     							= self.size['shortest_edge']
            __snake_case				:      str     							= self.size['shortest_edge']

      else:
         __snake_case				:      List[Any]     							= []
         for image in image_inputs:
            __snake_case							,__snake_case				:      List[Any]     							= self.get_expected_values([image])
            expected_values.append((expected_height, expected_width))
         __snake_case				:      Optional[Any]     							= max(__a					,   key=lambda __a: item[0])[0]
         __snake_case				:      int     							= max(__a					,   key=lambda __a: item[1])[1]

      return expected_height, expected_width




@require_torch
@require_vision
class a_    (    UpperCamelCase_		,      unittest.TestCase							):
   _snake_case        =							DetaImageProcessor if is_vision_available() else None







   def     SCREAMING_SNAKE_CASE__					(self)			->      int:
      """simple docstring"""






      __snake_case				:      Optional[Any]     							= DetaImageProcessingTester(self)







   @property
   def     SCREAMING_SNAKE_CASE__					(self)			->      Union[str, Any]:
      """simple docstring"""






      return self.image_processor_tester.prepare_image_processor_dict()







   def     SCREAMING_SNAKE_CASE__					(self)			->      Optional[int]:
      """simple docstring"""






      __snake_case				:      str     							= self.image_processing_class(**self.image_processor_dict)
      self.assertTrue(hasattr(__a					,   'image_mean'))
      self.assertTrue(hasattr(__a					,   'image_std'))
      self.assertTrue(hasattr(__a					,   'do_normalize'))
      self.assertTrue(hasattr(__a					,   'do_resize'))
      self.assertTrue(hasattr(__a					,   'do_rescale'))
      self.assertTrue(hasattr(__a					,   'do_pad'))
      self.assertTrue(hasattr(__a					,   'size'))







   def     SCREAMING_SNAKE_CASE__					(self)			->      int:
      """simple docstring"""






      __snake_case				:      List[Any]     							= 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					,   __a)







   def     SCREAMING_SNAKE_CASE__					(self)			->      List[str]:
      """simple docstring"""






      pass







   def     SCREAMING_SNAKE_CASE__					(self)			->      int:
      """simple docstring"""






      __snake_case				:      Optional[int]     							= self.image_processing_class(**self.image_processor_dict)
      # create random PIL images
      __snake_case				:      Dict     							= prepare_image_inputs(self.image_processor_tester					,   equal_resolution=__a)
      for image in image_inputs:
         self.assertIsInstance(__a					,   Image.Image)

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

      __snake_case							,__snake_case				:      Any     							= self.image_processor_tester.get_expected_values(__a)

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

      # Test batched
      __snake_case							,__snake_case				:      List[Any]     							= self.image_processor_tester.get_expected_values(__a					,   batched=__a)

      __snake_case				:      List[Any]     							= image_processing(__a					,   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)			->      Tuple:
      """simple docstring"""






      __snake_case				:      Union[str, Any]     							= self.image_processing_class(**self.image_processor_dict)
      # create random numpy tensors
      __snake_case				:      List[str]     							= prepare_image_inputs(self.image_processor_tester					,   equal_resolution=__a					,   numpify=__a)
      for image in image_inputs:
         self.assertIsInstance(__a					,   np.ndarray)

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

      __snake_case							,__snake_case				:      List[str]     							= self.image_processor_tester.get_expected_values(__a)

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

      # Test batched
      __snake_case				:      Any     							= image_processing(__a					,   return_tensors='pt').pixel_values

      __snake_case							,__snake_case				:      List[str]     							= self.image_processor_tester.get_expected_values(__a					,   batched=__a)

      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]:
      """simple docstring"""






      __snake_case				:      str     							= self.image_processing_class(**self.image_processor_dict)
      # create random PyTorch tensors
      __snake_case				:      Tuple     							= prepare_image_inputs(self.image_processor_tester					,   equal_resolution=__a					,   torchify=__a)
      for image in image_inputs:
         self.assertIsInstance(__a					,   torch.Tensor)

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

      __snake_case							,__snake_case				:      Optional[Any]     							= self.image_processor_tester.get_expected_values(__a)

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

      # Test batched
      __snake_case				:      Any     							= image_processing(__a					,   return_tensors='pt').pixel_values

      __snake_case							,__snake_case				:      str     							= self.image_processor_tester.get_expected_values(__a					,   batched=__a)

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







   @slow
   def     SCREAMING_SNAKE_CASE__					(self)			->      List[Any]:
      """simple docstring"""






      __snake_case				:      Optional[int]     							= Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png')
      with open('./tests/fixtures/tests_samples/COCO/coco_annotations.txt'					,   'r') as f:
         __snake_case				:      Optional[int]     							= json.loads(f.read())

      __snake_case				:      str     							= {'image_id': 3_9_7_6_9, 'annotations': target}

      # encode them
      __snake_case				:      List[Any]     							= DetaImageProcessor()
      __snake_case				:      Optional[Any]     							= image_processing(images=__a					,   annotations=__a					,   return_tensors='pt')

      # verify pixel values
      __snake_case				:      Union[str, Any]     							= torch.Size([1, 3, 8_0_0, 1_0_6_6])
      self.assertEqual(encoding['pixel_values'].shape					,   __a)

      __snake_case				:      List[str]     							= torch.tensor([0.2_796, 0.3_138, 0.3_481])
      self.assertTrue(torch.allclose(encoding['pixel_values'][0, 0, 0, :3]					,   __a					,   atol=1E-4))

      # verify area
      __snake_case				:      Optional[int]     							= torch.tensor([5_887.9_600, 11_250.2_061, 489_353.8_438, 837_122.7_500, 147_967.5_156, 165_732.3_438])
      self.assertTrue(torch.allclose(encoding['labels'][0]['area']					,   __a))
      # verify boxes
      __snake_case				:      Any     							= torch.Size([6, 4])
      self.assertEqual(encoding['labels'][0]['boxes'].shape					,   __a)
      __snake_case				:      str     							= torch.tensor([0.5_503, 0.2_765, 0.0_604, 0.2_215])
      self.assertTrue(torch.allclose(encoding['labels'][0]['boxes'][0]					,   __a					,   atol=1E-3))
      # verify image_id
      __snake_case				:      List[str]     							= torch.tensor([3_9_7_6_9])
      self.assertTrue(torch.allclose(encoding['labels'][0]['image_id']					,   __a))
      # verify is_crowd
      __snake_case				:      Optional[Any]     							= torch.tensor([0, 0, 0, 0, 0, 0])
      self.assertTrue(torch.allclose(encoding['labels'][0]['iscrowd']					,   __a))
      # verify class_labels
      __snake_case				:      Optional[Any]     							= torch.tensor([7_5, 7_5, 6_3, 6_5, 1_7, 1_7])
      self.assertTrue(torch.allclose(encoding['labels'][0]['class_labels']					,   __a))
      # verify orig_size
      __snake_case				:      Dict     							= torch.tensor([4_8_0, 6_4_0])
      self.assertTrue(torch.allclose(encoding['labels'][0]['orig_size']					,   __a))
      # verify size
      __snake_case				:      Dict     							= torch.tensor([8_0_0, 1_0_6_6])
      self.assertTrue(torch.allclose(encoding['labels'][0]['size']					,   __a))







   @slow
   def     SCREAMING_SNAKE_CASE__					(self)			->      Dict:
      """simple docstring"""






      __snake_case				:      Tuple     							= Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png')
      with open('./tests/fixtures/tests_samples/COCO/coco_panoptic_annotations.txt'					,   'r') as f:
         __snake_case				:      List[Any]     							= json.loads(f.read())

      __snake_case				:      List[str]     							= {'file_name': '000000039769.png', 'image_id': 3_9_7_6_9, 'segments_info': target}

      __snake_case				:      int     							= pathlib.Path('./tests/fixtures/tests_samples/COCO/coco_panoptic')

      # encode them
      __snake_case				:      Union[str, Any]     							= DetaImageProcessor(format='coco_panoptic')
      __snake_case				:      Dict     							= image_processing(images=__a					,   annotations=__a					,   masks_path=__a					,   return_tensors='pt')

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

      __snake_case				:      List[str]     							= torch.tensor([0.2_796, 0.3_138, 0.3_481])
      self.assertTrue(torch.allclose(encoding['pixel_values'][0, 0, 0, :3]					,   __a					,   atol=1E-4))

      # verify area
      __snake_case				:      Dict     							= torch.tensor([147_979.6_875, 165_527.0_469, 484_638.5_938, 11_292.9_375, 5_879.6_562, 7_634.1_147])
      self.assertTrue(torch.allclose(encoding['labels'][0]['area']					,   __a))
      # verify boxes
      __snake_case				:      Tuple     							= torch.Size([6, 4])
      self.assertEqual(encoding['labels'][0]['boxes'].shape					,   __a)
      __snake_case				:      Tuple     							= torch.tensor([0.2_625, 0.5_437, 0.4_688, 0.8_625])
      self.assertTrue(torch.allclose(encoding['labels'][0]['boxes'][0]					,   __a					,   atol=1E-3))
      # verify image_id
      __snake_case				:      Dict     							= torch.tensor([3_9_7_6_9])
      self.assertTrue(torch.allclose(encoding['labels'][0]['image_id']					,   __a))
      # verify is_crowd
      __snake_case				:      Tuple     							= torch.tensor([0, 0, 0, 0, 0, 0])
      self.assertTrue(torch.allclose(encoding['labels'][0]['iscrowd']					,   __a))
      # verify class_labels
      __snake_case				:      Optional[Any]     							= torch.tensor([1_7, 1_7, 6_3, 7_5, 7_5, 9_3])
      self.assertTrue(torch.allclose(encoding['labels'][0]['class_labels']					,   __a))
      # verify masks
      __snake_case				:      Optional[int]     							= 8_2_2_8_7_3
      self.assertEqual(encoding['labels'][0]['masks'].sum().item()					,   __a)
      # verify orig_size
      __snake_case				:      Optional[int]     							= torch.tensor([4_8_0, 6_4_0])
      self.assertTrue(torch.allclose(encoding['labels'][0]['orig_size']					,   __a))
      # verify size
      __snake_case				:      Tuple     							= torch.tensor([8_0_0, 1_0_6_6])
      self.assertTrue(torch.allclose(encoding['labels'][0]['size']					,   __a))







'''simple docstring'''






from __future__ import annotations

import math
import random
from collections.abc import Collection
from typing import overload




class a_    :







   def __init__(self					,   __a = None)			->      None:
      """simple docstring"""






      if components is None:
         __snake_case				:      List[str]     							= []
      __snake_case				:      Optional[int]     							= list(__a)







   def __len__(self)			->      int:
      """simple docstring"""






      return len(self.__components)







   def __str__(self)			->      str:
      """simple docstring"""






      return "(" + ",".join(map(__a					,   self.__components)) + ")"







   def __add__(self					,   __a)			->      Vector:
      """simple docstring"""






      __snake_case				:      Optional[Any]     							= len(self)
      if size == len(__a):
         __snake_case				:      Optional[int]     							= [self.__components[i] + other.component(__a) for i in range(__a)]
         return Vector(__a)
      else:
         raise Exception('must have the same size')







   def __sub__(self					,   __a)			->      Vector:
      """simple docstring"""






      __snake_case				:      Optional[Any]     							= len(self)
      if size == len(__a):
         __snake_case				:      Optional[int]     							= [self.__components[i] - other.component(__a) for i in range(__a)]
         return Vector(__a)
      else:  # error case
         raise Exception('must have the same size')







   @overload
   def __mul__(self					,   __a)			->      Vector:
      """simple docstring"""






      ...







   @overload
   def __mul__(self					,   __a)			->      float:
      """simple docstring"""






      ...







   def __mul__(self					,   __a)			->      float | Vector:
      """simple docstring"""






      if isinstance(__a					,   (float, int)):
         __snake_case				:      str     							= [c * other for c in self.__components]
         return Vector(__a)
      elif isinstance(__a					,   __a) and len(self) == len(__a):
         __snake_case				:      List[Any]     							= len(self)
         __snake_case				:      Dict     							= [self.__components[i] * other.component(__a) for i in range(__a)]
         return sum(__a)
      else:  # error case
         raise Exception('invalid operand!')







   def     SCREAMING_SNAKE_CASE__					(self)			->      Vector:
      """simple docstring"""






      return Vector(self.__components)







   def     SCREAMING_SNAKE_CASE__					(self					,   __a)			->      float:
      """simple docstring"""






      if isinstance(__a					,   __a) and -len(self.__components) <= i < len(self.__components):
         return self.__components[i]
      else:
         raise Exception('index out of range')







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a)			->      None:
      """simple docstring"""






      assert -len(self.__components) <= pos < len(self.__components)
      __snake_case				:      int     							= value







   def     SCREAMING_SNAKE_CASE__					(self)			->      float:
      """simple docstring"""






      if len(self.__components) == 0:
         raise Exception('Vector is empty')
      __snake_case				:      Tuple     							= [c**2 for c in self.__components]
      return math.sqrt(sum(__a))







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a = False)			->      float:
      """simple docstring"""






      __snake_case				:      Tuple     							= self * other
      __snake_case				:      Optional[int]     							= self.euclidean_length() * other.euclidean_length()
      if deg:
         return math.degrees(math.acos(num / den))
      else:
         return math.acos(num / den)




def        _SCREAMING_SNAKE_CASE  (				A  :       int  )    -> Vector:







   """simple docstring"""
   assert isinstance(A  ,		A  )
   return Vector([0] * dimension  )




def        _SCREAMING_SNAKE_CASE  (				A  :       int  ,		A  :       int  )    -> Vector:







   """simple docstring"""
   assert isinstance(A  ,		A  ) and (isinstance(A  ,		A  ))
   __snake_case				:      Any     							= [0] * dimension
   __snake_case				:      int     							= 1
   return Vector(A  )




def        _SCREAMING_SNAKE_CASE  (				A  :       float  ,		A  :       Vector  ,		A  :       Vector  )    -> Vector:







   """simple docstring"""
   assert (
       isinstance(A  ,		A  )
       and isinstance(A  ,		A  )
       and (isinstance(A  ,		(int, float)  ))
   )
   return x * scalar + y




def        _SCREAMING_SNAKE_CASE  (				A  :       int  ,		A  :       int  ,		A  :       int  )    -> Vector:







   """simple docstring"""
   random.seed(A  )
   __snake_case				:      List[Any]     							= [random.randint(A  ,		A  ) for _ in range(A  )]
   return Vector(A  )




class a_    :







   def __init__(self					,   __a					,   __a					,   __a)			->      None:
      """simple docstring"""






      __snake_case				:      Union[str, Any]     							= matrix
      __snake_case				:      int     							= w
      __snake_case				:      str     							= h







   def __str__(self)			->      str:
      """simple docstring"""






      __snake_case				:      Dict     							= ''
      for i in range(self.__height):
         ans += "|"
         for j in range(self.__width):
            if j < self.__width - 1:
               ans += str(self.__matrix[i][j]) + ","
            else:
               ans += str(self.__matrix[i][j]) + "|\n"
      return ans







   def __add__(self					,   __a)			->      Matrix:
      """simple docstring"""






      if self.__width == other.width() and self.__height == other.height():
         __snake_case				:      Tuple     							= []
         for i in range(self.__height):
            __snake_case				:      List[Any]     							= [
                self.__matrix[i][j] + other.component(__a					,   __a)
                for j in range(self.__width)
            ]
            matrix.append(__a)
         return Matrix(__a					,   self.__width					,   self.__height)
      else:
         raise Exception('matrix must have the same dimension!')







   def __sub__(self					,   __a)			->      Matrix:
      """simple docstring"""






      if self.__width == other.width() and self.__height == other.height():
         __snake_case				:      str     							= []
         for i in range(self.__height):
            __snake_case				:      List[str]     							= [
                self.__matrix[i][j] - other.component(__a					,   __a)
                for j in range(self.__width)
            ]
            matrix.append(__a)
         return Matrix(__a					,   self.__width					,   self.__height)
      else:
         raise Exception('matrices must have the same dimension!')







   @overload
   def __mul__(self					,   __a)			->      Matrix:
      """simple docstring"""






      ...







   @overload
   def __mul__(self					,   __a)			->      Vector:
      """simple docstring"""






      ...







   def __mul__(self					,   __a)			->      Vector | Matrix:
      """simple docstring"""






      if isinstance(__a					,   __a):  # matrix-vector
         if len(__a) == self.__width:
            __snake_case				:      Tuple     							= zero_vector(self.__height)
            for i in range(self.__height):
               __snake_case				:      Union[str, Any]     							= [
                   self.__matrix[i][j] * other.component(__a)
                   for j in range(self.__width)
               ]
               ans.change_component(__a					,   sum(__a))
            return ans
         else:
            raise Exception(
                'vector must have the same size as the '
                'number of columns of the matrix!')
      elif isinstance(__a					,   (int, float)):  # matrix-scalar
         __snake_case				:      str     							= [
             [self.__matrix[i][j] * other for j in range(self.__width)]
             for i in range(self.__height)
         ]
         return Matrix(__a					,   self.__width					,   self.__height)
      return None







   def     SCREAMING_SNAKE_CASE__					(self)			->      int:
      """simple docstring"""






      return self.__height







   def     SCREAMING_SNAKE_CASE__					(self)			->      int:
      """simple docstring"""






      return self.__width







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a)			->      float:
      """simple docstring"""






      if 0 <= x < self.__height and 0 <= y < self.__width:
         return self.__matrix[x][y]
      else:
         raise Exception('change_component: indices out of bounds')







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a					,   __a)			->      None:
      """simple docstring"""






      if 0 <= x < self.__height and 0 <= y < self.__width:
         __snake_case				:      List[Any]     							= value
      else:
         raise Exception('change_component: indices out of bounds')







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a)			->      float:
      """simple docstring"""






      if self.__height != self.__width:
         raise Exception('Matrix is not square')
      __snake_case				:      List[Any]     							= self.__matrix[:x] + self.__matrix[x + 1 :]
      for i in range(len(__a)):
         __snake_case				:      Tuple     							= minor[i][:y] + minor[i][y + 1 :]
      return Matrix(__a					,   self.__width - 1					,   self.__height - 1).determinant()







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a)			->      float:
      """simple docstring"""






      if self.__height != self.__width:
         raise Exception('Matrix is not square')
      if 0 <= x < self.__height and 0 <= y < self.__width:
         return (-1) ** (x + y) * self.minor(__a					,   __a)
      else:
         raise Exception('Indices out of bounds')







   def     SCREAMING_SNAKE_CASE__					(self)			->      float:
      """simple docstring"""






      if self.__height != self.__width:
         raise Exception('Matrix is not square')
      if self.__height < 1:
         raise Exception('Matrix has no element')
      elif self.__height == 1:
         return self.__matrix[0][0]
      elif self.__height == 2:
         return (
             self.__matrix[0][0] * self.__matrix[1][1]
             - self.__matrix[0][1] * self.__matrix[1][0]
         )
      else:
         __snake_case				:      Any     							= [
             self.__matrix[0][y] * self.cofactor(0					,   __a) for y in range(self.__width)
         ]
         return sum(__a)




def        _SCREAMING_SNAKE_CASE  (				A  :       int  )    -> Matrix:







   """simple docstring"""
   __snake_case				:      list[list[float]]     							= [[0] * n for _ in range(A  )]
   return Matrix(A  ,		A  ,		A  )





def        _SCREAMING_SNAKE_CASE  (				A  :       int  ,		A  :       int  ,		A  :       int  ,		A  :       int  )    -> Matrix:







   """simple docstring"""
   random.seed(A  )
   __snake_case				:      list[list[float]]     							= [
       [random.randint(A  ,		A  ) for _ in range(A  )] for _ in range(A  )
   ]
   return Matrix(A  ,		A  ,		A  )