

import platform
from argparse import ArgumentParser

import huggingface_hub
import pandas
import pyarrow

from datasets import __version__ as version
from datasets.commands import BaseDatasetsCLICommand



def        _lowerCAmelCase      (						UpperCAmelCase     :							Any				):


					'''simple docstring'''






					return EnvironmentCommand()







class     __a   (      snake_case__    ):

			"""simple docstring"""

			@staticmethod
			def    _lowerCAmelCase			(							lowercase_     :					ArgumentParser						):
								UpperCamelCase__		:    Dict         =parser.add_parser('''env'''						,  help='''Print relevant system environment info.'''						)
								download_parser.set_defaults(func=lowercase_						)






			def    _lowerCAmelCase			(							self     :					int						):
								UpperCamelCase__		:    Tuple         ={
								    '''`datasets` version''': version,
								    '''Platform''': platform.platform(),
								    '''Python version''': platform.python_version(),
								    '''Huggingface_hub version''': huggingface_hub.__version__,
								    '''PyArrow version''': pyarrow.__version__,
								    '''Pandas version''': pandas.__version__,
								}

								print('''\nCopy-and-paste the text below in your GitHub issue.\n'''						)
								print(self.format_dict(lowercase_						)						)

								return info






			@staticmethod
			def    _lowerCAmelCase			(							lowercase_     :					Any						):
								return "\n".join([f'''- {prop}: {val}''' for prop, val in d.items()]						) + "\n"





"""simple docstring"""





def        _lowerCAmelCase      (						UpperCAmelCase     :							list[list[int]]				):


					'''simple docstring'''






					UpperCamelCase__		:    Dict         =[list(UpperCAmelCase				) for row in matrix]
					if matrix and isinstance(UpperCAmelCase      ,							UpperCAmelCase				):
										if isinstance(matrix[0]      ,							UpperCAmelCase				):
															UpperCamelCase__		:    List[Any]         =0
															for row in matrix:
																				if prev_len == 0:
																									UpperCamelCase__		:    Optional[Any]         =len(UpperCAmelCase				)
																									UpperCamelCase__		:    Optional[int]         =True
																				else:
																									UpperCamelCase__		:    List[str]         =prev_len == len(UpperCAmelCase				)
										else:
															UpperCamelCase__		:    Tuple         =True
					else:
										UpperCamelCase__		:    Optional[Any]         =False

					return result



def        _lowerCAmelCase      (						UpperCAmelCase     :							list[list[int]]				):


					'''simple docstring'''






					if check_matrix(UpperCAmelCase				) and len(UpperCAmelCase				) > 0:
										UpperCamelCase__		:    Optional[int]         =[list(UpperCAmelCase				) for row in a]
										UpperCamelCase__		:    Any         =len(UpperCAmelCase				)
										if isinstance(a[0]      ,							UpperCAmelCase				):
															UpperCamelCase__		:    Tuple         =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]				)
										UpperCamelCase__		:    Tuple         =[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        _lowerCAmelCase      (						UpperCAmelCase     :							list[list]				):


					'''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()

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


