




from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCamelCase__            =     logging.get_logger(__name__)

UpperCamelCase__            =     {
    """MBZUAI/swiftformer-xs""": """https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json""",
}
class      a__       (   snake_case__ ):
						_a				:       Tuple   =       'swiftformer'






						def __init__(  self						,     _A=3						,     _A=[3, 3, 6, 4]						,     _A=[4_8, 5_6, 1_1_2, 2_2_0]						,     _A=4						,     _A=[True, True, True, True]						,     _A="gelu"						,     _A=3						,     _A=2						,     _A=1						,     _A=0.0						,     _A=True						,     _A=1E-5						,     _A=1E-5						,     **_A						,     ):




											"""simple docstring"""



											super().__init__(**_snake_case     )
											__lowerCAmelCase							  =			num_channels
											__lowerCAmelCase							  =			depths
											__lowerCAmelCase							  =			embed_dims
											__lowerCAmelCase							  =			mlp_ratio
											__lowerCAmelCase							  =			downsamples
											__lowerCAmelCase							  =			hidden_act
											__lowerCAmelCase							  =			down_patch_size
											__lowerCAmelCase							  =			down_stride
											__lowerCAmelCase							  =			down_pad
											__lowerCAmelCase							  =			drop_path_rate
											__lowerCAmelCase							  =			use_layer_scale
											__lowerCAmelCase							  =			layer_scale_init_value
											__lowerCAmelCase							  =			batch_norm_eps






class      a__       (   snake_case__ ):
						_a				:       Union[str, Any]   =       version.parse("""1.11""" )






						@property
						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											return OrderedDict(
											    [
											        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
											    ]     )






						@property
						def 							__SCREAMING_SNAKE_CASE(  self     ):




											"""simple docstring"""



											return 1E-4












UpperCamelCase											=      [
    [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   (							lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__				)  ->      bool:
 return 0 <= row < rows and 0 <= col < cols




def       _a   (							lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__				)  ->      int:
 lowerCamelCase_							:    Tuple							=     len(lowerCamelCase__				)
 lowerCamelCase_							:    Tuple							=     len(mat[0]				)
 if is_safe(lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__				) and (row, col) not in seen and mat[row][col] == 1:
  seen.add((row, col)				)
  return (
      1
      + depth_first_search(row + 1 ,			lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__				)
      + depth_first_search(row - 1 ,			lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__				)
      + depth_first_search(lowerCamelCase__ ,			col + 1 ,			lowerCamelCase__ ,			lowerCamelCase__				)
      + depth_first_search(lowerCamelCase__ ,			col - 1 ,			lowerCamelCase__ ,			lowerCamelCase__				)
  )
 else:
  return 0




def       _a   (							lowerCamelCase__				)  ->      int:
 lowerCamelCase_							:    set							=     set()

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


if __name__ == "__main__":
       import doctest

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