





UpperCamelCase__ :			Optional[Any]       	=			[
    [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0],
]




def  A_(      A					,   A					,   A					,   A ):
	return 0 <= row < rows and 0 <= col < cols




def  A_(      A					,   A					,   A					,   A ):
	UpperCAmelCase_		    =  len(UpperCamelCase_ )
	UpperCAmelCase_		    =  len(mat[0] )
	if is_safe(UpperCamelCase_					,   UpperCamelCase_					,   UpperCamelCase_					,   UpperCamelCase_ ) and (row, col) not in seen and mat[row][col] == 1:
		seen.add((row, col) )
		return (
		    1
		    + depth_first_search(row + 1					,   UpperCamelCase_					,   UpperCamelCase_					,   UpperCamelCase_ )
		    + depth_first_search(row - 1					,   UpperCamelCase_					,   UpperCamelCase_					,   UpperCamelCase_ )
		    + depth_first_search(UpperCamelCase_					,   col + 1					,   UpperCamelCase_					,   UpperCamelCase_ )
		    + depth_first_search(UpperCamelCase_					,   col - 1					,   UpperCamelCase_					,   UpperCamelCase_ )
		)
	else:
		return 0




def  A_(      A ):
	UpperCAmelCase_		    =  set()

	UpperCAmelCase_		    =  0
	for row, line in enumerate(UpperCamelCase_ ):
		for col, item in enumerate(UpperCamelCase_ ):
			if item == 1 and (row, col) not in seen:
				# Maximizing the area
				UpperCAmelCase_		    =  max(UpperCamelCase_					,   depth_first_search(UpperCamelCase_					,   UpperCamelCase_					,   UpperCamelCase_					,   UpperCamelCase_ ) )
	return max_area


if __name__ == "__main__":
				import doctest

				print(find_max_area(matrix))  # Output -> 6
				doctest.testmod()










"""simple docstring"""


import importlib.metadata
import subprocess
import sys




def 					a			(  UpperCamelCase_				:					bool = False		)	->		Optional[Any]:
 __A						:							List[Any]      =						False
 if "IPython" in sys.modules:
  __A						:							List[Any]      =						'google.colab' in str(sys.modules['IPython'].get_ipython()		)

 if in_colab:
  if upgrade:
   __A						:							Dict      =						['pip', 'install', '-U', 'torch']
   subprocess.run(UpperCamelCase_  ,						check=UpperCamelCase_		)
  # get the current version of torch
  __A						:							int      =						importlib.metadata.version('torch'		)
  __A						:							int      =						torch_version[: torch_version.rindex('.'		)]
  __A						:							Any      =						F"https://storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-{torch_version_trunc}-cp37-cp37m-linux_x86_64.whl"
  __A						:							int      =						['pip', 'install', xla_wheel]
  subprocess.run(UpperCamelCase_  ,						check=UpperCamelCase_		)
 else:
  raise RuntimeError('`install_xla` utility works only on google colab.'		)





