




'''simple docstring'''







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   A__         =    [list(UpperCAmelCase	) for row in matrix]
   if matrix and isinstance(UpperCAmelCase			,UpperCAmelCase	):
      if isinstance(matrix[0]			,UpperCAmelCase	):
         A__         =    0
         for row in matrix:
            if prev_len == 0:
               A__         =    len(UpperCAmelCase	)
               A__         =    True
            else:
               A__         =    prev_len == len(UpperCAmelCase	)
      else:
         A__         =    True
   else:
      A__         =    False

   return result







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   if check_matrix(UpperCAmelCase	) and len(UpperCAmelCase	) > 0:
      A__         =    [list(UpperCAmelCase	) for row in a]
      A__         =    len(UpperCAmelCase	)
      if isinstance(a[0]			,UpperCAmelCase	):
         A__         =    len(a[0]	)
      else:
         for dat in a:
            print(UpperCAmelCase	)
         return

      # horizotal printing increasing
      for i in range(0			,UpperCAmelCase	):
         print(a[0][i]	)
      # vertical printing down
      for i in range(1			,UpperCAmelCase	):
         print(a[i][mat_col - 1]	)
      # horizotal printing decreasing
      if mat_row > 1:
         for i in range(mat_col - 2			,-1			,-1	):
            print(a[mat_row - 1][i]	)
        # vertical printing up
      for i in range(mat_row - 2			,0			,-1	):
         print(a[i][0]	)
      A__         =    [row[1 : mat_col - 1] for row in a[1 : mat_row - 1]]
      if len(UpperCAmelCase	) > 0:
         spiral_print_clockwise(UpperCAmelCase	)
      else:
         return
   else:
      print('Not a valid matrix'	)
      return







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   if matrix:
      return list(matrix.pop(0	)	) + spiral_traversal(list(zip(*UpperCAmelCase	)	)[::-1]	)
   else:
      return []


# driver code
if __name__ == "__main__":
    import doctest

    doctest.testmod()

    lowerCAmelCase_    	=							[[1, 2, 3, 4], [5, 6, 7, 8], [9, 1_0, 1_1, 1_2]]
    spiral_print_clockwise(a)










'''simple docstring'''







from __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
lowerCAmelCase_    	=							TypeVar('''T''', bound='''Enum''')

@unique
class   _snake_case( UpperCAmelCase			):
 __snake_case:       List[Any]									=				80
 __snake_case:       Optional[int]									=				70
 __snake_case:       Optional[int]									=				60
 __snake_case:       int									=				50
 __snake_case:       Dict									=				40
 __snake_case:       Dict									=				30
 __snake_case:       str									=				20
 __snake_case:       Optional[int]									=				10




@unique
class   _snake_case( UpperCAmelCase			):
 __snake_case:       List[Any]									=				24
 __snake_case:       Union[str, Any]									=				21
 __snake_case:       Dict									=				18
 __snake_case:       List[str]									=				15
 __snake_case:       Union[str, Any]									=				12
 __snake_case:       Tuple									=				9
 __snake_case:       int									=				6
 __snake_case:       Tuple									=				3
 __snake_case:       List[Any]									=				2
 __snake_case:       int									=				1
 __snake_case:       List[str]									=				-1
 __snake_case:       Union[str, Any]									=				-2
 __snake_case:       List[str]									=				-3
 __snake_case:       Any									=				-6
 __snake_case:       Tuple									=				-9
 __snake_case:       List[str]									=				-12
 __snake_case:       Dict									=				-15
 __snake_case:       Optional[int]									=				-18
 __snake_case:       str									=				-21
 __snake_case:       Any									=				-24






 @classmethod
 def 	_UpperCamelCase   (cls					:     type[T]						)					->      dict:






    """simple docstring"""


    return {unit.name: unit.value for unit in cls if unit.value > 0}






 @classmethod
 def 	_UpperCamelCase   (cls					:     type[T]						)					->      dict:






    """simple docstring"""


    return {unit.name: unit.value for unit in cls if unit.value < 0}







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   A__         =    SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
   for name_prefix, value_prefix in prefixes.items():
      A__         =    value / (10**value_prefix)
      if numerical_part > 1:
         return F"""{numerical_part!s} {name_prefix}"""
   return str(UpperCAmelCase	)







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   for prefix in BinaryUnit:
      A__         =    value / (2**prefix.value)
      if numerical_part > 1:
         return F"""{numerical_part!s} {prefix.name}"""
   return str(UpperCAmelCase	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()


