


'''simple docstring'''







from __future__ import annotations






def 			lowercase				(_A					):







       """simple docstring"""







       _lowerCAmelCase    :							Optional[int]   			=       len(_A					)
       # We need to create solution object to save path.
       _lowerCAmelCase    :							List[str]   			=       [[0 for _ in range(_A					)] for _ in range(_A					)]
       _lowerCAmelCase    :							Optional[int]   			=       run_maze(_A   ,						0   ,						0   ,						_A					)
       if solved:
              print('\n'.join(str(_A					) for row in solutions					)					)
       else:
              print('No solution exists!'					)
       return solved






def 			lowercase				(_A   ,						_A   ,						_A   ,						_A					):







       """simple docstring"""







       _lowerCAmelCase    :							List[Any]   			=       len(_A					)
       # Final check point.
       if i == j == (size - 1):
              _lowerCAmelCase    :							Any   			=       1
              return True

       _lowerCAmelCase    :							Dict   			=       (not i < 0) and (not j < 0)  # Check lower bounds
       _lowerCAmelCase    :							Any   			=       (i < size) and (j < size)  # Check upper bounds

       if lower_flag and upper_flag:
              # check for already visited and block points.
              _lowerCAmelCase    :							str   			=       (not solutions[i][j]) and (not maze[i][j])
              if block_flag:
                     # check visited
                     _lowerCAmelCase    :							Union[str, Any]   			=       1

                     # check for directions
                     if (
                         run_maze(_A   ,						i + 1   ,						_A   ,						_A					)
                         or run_maze(_A   ,						_A   ,						j + 1   ,						_A					)
                         or run_maze(_A   ,						i - 1   ,						_A   ,						_A					)
                         or run_maze(_A   ,						_A   ,						j - 1   ,						_A					)
                     ):
                            return True

                     _lowerCAmelCase    :							Tuple   			=       0
                     return False
       return False


if __name__ == "__main__":
       import doctest

       doctest.testmod()






'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase    :     Any					=						{
    """configuration_x_clip""": [
        """XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """XCLIPConfig""",
        """XCLIPTextConfig""",
        """XCLIPVisionConfig""",
    ],
    """processing_x_clip""": ["""XCLIPProcessor"""],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase    :     Optional[Any]					=						[
           """XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """XCLIPModel""",
           """XCLIPPreTrainedModel""",
           """XCLIPTextModel""",
           """XCLIPVisionModel""",
       ]

if TYPE_CHECKING:
       from .configuration_x_clip import (
           XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
           XCLIPConfig,
           XCLIPTextConfig,
           XCLIPVisionConfig,
       )
       from .processing_x_clip import XCLIPProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_x_clip import (
                  XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
                  XCLIPModel,
                  XCLIPPreTrainedModel,
                  XCLIPTextModel,
                  XCLIPVisionModel,
              )

else:
       import sys

       lowerCAmelCase    :     Dict					=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

