





def 			SCREAMING_SNAKE_CASE__     (					_lowercase    :   list[list[int]] )      ->       bool:




							'''simple docstring'''
							lowercase__				:			List[Any]            =		[list(_lowercase ) for row in matrix]
							if matrix and isinstance(_lowercase      ,						_lowercase ):
														if isinstance(matrix[0]      ,						_lowercase ):
																					lowercase__				:			str            =		0
																					for row in matrix:
																												if prev_len == 0:
																																			lowercase__				:			Any            =		len(_lowercase )
																																			lowercase__				:			Any            =		True
																												else:
																																			lowercase__				:			Optional[int]            =		prev_len == len(_lowercase )
														else:
																					lowercase__				:			str            =		True
							else:
														lowercase__				:			Optional[int]            =		False

							return result


def 			SCREAMING_SNAKE_CASE__     (					_lowercase    :   list[list[int]] )      ->       None:




							'''simple docstring'''
							if check_matrix(_lowercase ) and len(_lowercase ) > 0:
														lowercase__				:			str            =		[list(_lowercase ) for row in a]
														lowercase__				:			List[str]            =		len(_lowercase )
														if isinstance(a[0]      ,						_lowercase ):
																					lowercase__				:			Union[str, Any]            =		len(a[0] )
														else:
																					for dat in a:
																												print(_lowercase )
																					return

														# horizotal printing increasing
														for i in range(0      ,						_lowercase ):
																					print(a[0][i] )
														# vertical printing down
														for i in range(1      ,						_lowercase ):
																					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] )
														lowercase__				:			Tuple            =		[row[1 : mat_col - 1] for row in a[1 : mat_row - 1]]
														if len(_lowercase ) > 0:
																					spiral_print_clockwise(_lowercase )
														else:
																					return
							else:
														print('Not a valid matrix' )
														return


def 			SCREAMING_SNAKE_CASE__     (					_lowercase    :   list[list] )      ->       list[int]:




							'''simple docstring'''
							if matrix:
														return list(matrix.pop(0 ) ) + spiral_traversal(list(zip(*_lowercase ) )[::-1] )
							else:
														return []


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

			doctest.testmod()

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









from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__UpperCamelCase:  Any   =   {
    """configuration_deta""": ["""DETA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DetaConfig"""],
}

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			__UpperCamelCase:  Tuple   =   ["""DetaImageProcessor"""]

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			__UpperCamelCase:  List[str]   =   [
			    """DETA_PRETRAINED_MODEL_ARCHIVE_LIST""",
			    """DetaForObjectDetection""",
			    """DetaModel""",
			    """DetaPreTrainedModel""",
			]


if TYPE_CHECKING:
			from .configuration_deta import DETA_PRETRAINED_CONFIG_ARCHIVE_MAP, DetaConfig

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .image_processing_deta import DetaImageProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_deta import (
						    DETA_PRETRAINED_MODEL_ARCHIVE_LIST,
						    DetaForObjectDetection,
						    DetaModel,
						    DetaPreTrainedModel,
						)

else:
			import sys

			__UpperCamelCase:  int   =   _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


