





__lowercase													=			[
    [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 					__SCREAMING_SNAKE_CASE  (							__lowercase:		int     ,							__lowercase:		int     ,							__lowercase:		int     ,							__lowercase:		int):



		'''simple docstring'''






		return 0 <= row < rows and 0 <= col < cols


def 					__SCREAMING_SNAKE_CASE  (							__lowercase:		int     ,							__lowercase:		int     ,							__lowercase:		set     ,							__lowercase:		list[list[int]]):



		'''simple docstring'''






		__lowerCAmelCase			=				len(lowercase__)
		__lowerCAmelCase			=				len(mat[0])
		if is_safe(lowercase__     ,							lowercase__     ,							lowercase__     ,							lowercase__) and (row, col) not in seen and mat[row][col] == 1:
				seen.add((row, col))
				return (
				    1
				    + depth_first_search(row + 1     ,							lowercase__     ,							lowercase__     ,							lowercase__)
				    + depth_first_search(row - 1     ,							lowercase__     ,							lowercase__     ,							lowercase__)
				    + depth_first_search(lowercase__     ,							col + 1     ,							lowercase__     ,							lowercase__)
				    + depth_first_search(lowercase__     ,							col - 1     ,							lowercase__     ,							lowercase__)
				)
		else:
				return 0


def 					__SCREAMING_SNAKE_CASE  (							__lowercase:		list[list[int]]):



		'''simple docstring'''






		__lowerCAmelCase			=				set()

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


if __name__ == "__main__":
						import doctest

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







import inspect
import os
import unittest

import torch

import accelerate
from accelerate import debug_launcher
from accelerate.test_utils import (
    execute_subprocess_async,
    require_cpu,
    require_multi_gpu,
    require_single_gpu,
    test_sync,
)
from accelerate.utils import patch_environment

class   __snake_case				(			unittest.TestCase   ):






    '''simple docstring'''





    def 	A		(   self						:		int							):

      """simple docstring"""





      __lowerCAmelCase			=				inspect.getfile(accelerate.test_utils							)
      __lowerCAmelCase			=				os.path.sep.join(mod_file.split(os.path.sep							)[:-1] + ['''scripts''', '''test_sync.py''']							)





    @require_cpu
    def 	A		(   self						:		str							):

      """simple docstring"""





      debug_launcher(test_sync.main			,						num_processes=1							)





    @require_cpu
    def 	A		(   self						:		List[str]							):

      """simple docstring"""





      debug_launcher(test_sync.main							)





    @require_single_gpu
    def 	A		(   self						:		Optional[Any]							):

      """simple docstring"""





      test_sync.main()





    @require_multi_gpu
    def 	A		(   self						:		Union[str, Any]							):

      """simple docstring"""





      print(f'''Found {torch.cuda.device_count()} devices.'''							)
      __lowerCAmelCase			=				['''torchrun''', f'''--nproc_per_node={torch.cuda.device_count()}''', self.test_file_path]
      with patch_environment(omp_num_threads=1							):
        execute_subprocess_async(snake_case			,						env=os.environ.copy()							)
