




a_ 		=  [
    [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_       ,  lowercase_       ,  lowercase_       ,  lowercase_   )							->						Optional[Any]:

    """simple docstring"""


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




def        __SCREAMING_SNAKE_CASE (	lowercase_       ,  lowercase_       ,  lowercase_       ,  lowercase_   )							->						Optional[int]:

    """simple docstring"""


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




def        __SCREAMING_SNAKE_CASE (	lowercase_   )							->						List[str]:

    """simple docstring"""


    __UpperCamelCase			=    set()

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


if __name__ == "__main__":
 import doctest

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










from typing import TYPE_CHECKING

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


_snake_case				=			{
    "configuration_oneformer": ["ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "OneFormerConfig"],
    "processing_oneformer": ["OneFormerProcessor"],
}

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _snake_case				=			["OneFormerImageProcessor"]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _snake_case				=			[
          "ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
          "OneFormerForUniversalSegmentation",
          "OneFormerModel",
          "OneFormerPreTrainedModel",
      ]

if TYPE_CHECKING:
      from .configuration_oneformer import ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, OneFormerConfig
      from .processing_oneformer import OneFormerProcessor

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .image_processing_oneformer import OneFormerImageProcessor
      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_oneformer import (
                ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                OneFormerForUniversalSegmentation,
                OneFormerModel,
                OneFormerPreTrainedModel,
            )


else:
      import sys

      _snake_case				=			_LazyModule(__name__, globals()["__file__"], _import_structure)



