"""simple docstring"""


import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible


class 				a (						unittest.TestCase      ):


    def    lowerCAmelCase_     (    self		:     Union[str, Any]    ):
      _UpperCAmelCase         =					[
          """safety_checker/pytorch_model.bin""",
          """safety_checker/model.safetensors""",
          """vae/diffusion_pytorch_model.bin""",
          """vae/diffusion_pytorch_model.safetensors""",
          """text_encoder/pytorch_model.bin""",
          """text_encoder/model.safetensors""",
          """unet/diffusion_pytorch_model.bin""",
          """unet/diffusion_pytorch_model.safetensors""",
      ]
      self.assertTrue(is_safetensors_compatible(__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     List[str]    ):
      _UpperCAmelCase         =					[
          """unet/diffusion_pytorch_model.bin""",
          """unet/diffusion_pytorch_model.safetensors""",
      ]
      self.assertTrue(is_safetensors_compatible(__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     Dict    ):
      _UpperCAmelCase         =					[
          """safety_checker/pytorch_model.bin""",
          """safety_checker/model.safetensors""",
          """vae/diffusion_pytorch_model.bin""",
          """vae/diffusion_pytorch_model.safetensors""",
          """text_encoder/pytorch_model.bin""",
          """text_encoder/model.safetensors""",
          """unet/diffusion_pytorch_model.bin""",
          # Removed: 'unet/diffusion_pytorch_model.safetensors',
      ]
      self.assertFalse(is_safetensors_compatible(__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     int    ):
      _UpperCAmelCase         =					[
          """text_encoder/pytorch_model.bin""",
          """text_encoder/model.safetensors""",
      ]
      self.assertTrue(is_safetensors_compatible(__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     List[str]    ):
      _UpperCAmelCase         =					[
          """safety_checker/pytorch_model.bin""",
          """safety_checker/model.safetensors""",
          """vae/diffusion_pytorch_model.bin""",
          """vae/diffusion_pytorch_model.safetensors""",
          """text_encoder/pytorch_model.bin""",
          # Removed: 'text_encoder/model.safetensors',
          """unet/diffusion_pytorch_model.bin""",
          """unet/diffusion_pytorch_model.safetensors""",
      ]
      self.assertFalse(is_safetensors_compatible(__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     Optional[int]    ):
      _UpperCAmelCase         =					[
          """safety_checker/pytorch_model.fp16.bin""",
          """safety_checker/model.fp16.safetensors""",
          """vae/diffusion_pytorch_model.fp16.bin""",
          """vae/diffusion_pytorch_model.fp16.safetensors""",
          """text_encoder/pytorch_model.fp16.bin""",
          """text_encoder/model.fp16.safetensors""",
          """unet/diffusion_pytorch_model.fp16.bin""",
          """unet/diffusion_pytorch_model.fp16.safetensors""",
      ]
      _UpperCAmelCase         =					"""fp16"""
      self.assertTrue(is_safetensors_compatible(__lowerCAmelCase      , variant=__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     Optional[int]    ):
      _UpperCAmelCase         =					[
          """unet/diffusion_pytorch_model.fp16.bin""",
          """unet/diffusion_pytorch_model.fp16.safetensors""",
      ]
      _UpperCAmelCase         =					"""fp16"""
      self.assertTrue(is_safetensors_compatible(__lowerCAmelCase      , variant=__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     int    ):
      # pass variant but use the non-variant filenames
      _UpperCAmelCase         =					[
          """unet/diffusion_pytorch_model.bin""",
          """unet/diffusion_pytorch_model.safetensors""",
      ]
      _UpperCAmelCase         =					"""fp16"""
      self.assertTrue(is_safetensors_compatible(__lowerCAmelCase      , variant=__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     Union[str, Any]    ):
      _UpperCAmelCase         =					[
          """safety_checker/pytorch_model.fp16.bin""",
          """safety_checker/model.fp16.safetensors""",
          """vae/diffusion_pytorch_model.fp16.bin""",
          """vae/diffusion_pytorch_model.fp16.safetensors""",
          """text_encoder/pytorch_model.fp16.bin""",
          """text_encoder/model.fp16.safetensors""",
          """unet/diffusion_pytorch_model.fp16.bin""",
          # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
      ]
      _UpperCAmelCase         =					"""fp16"""
      self.assertFalse(is_safetensors_compatible(__lowerCAmelCase      , variant=__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     List[Any]    ):
      _UpperCAmelCase         =					[
          """text_encoder/pytorch_model.fp16.bin""",
          """text_encoder/model.fp16.safetensors""",
      ]
      _UpperCAmelCase         =					"""fp16"""
      self.assertTrue(is_safetensors_compatible(__lowerCAmelCase      , variant=__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     Any    ):
      # pass variant but use the non-variant filenames
      _UpperCAmelCase         =					[
          """text_encoder/pytorch_model.bin""",
          """text_encoder/model.safetensors""",
      ]
      _UpperCAmelCase         =					"""fp16"""
      self.assertTrue(is_safetensors_compatible(__lowerCAmelCase      , variant=__lowerCAmelCase    )    )


    def    lowerCAmelCase_     (    self		:     str    ):
      _UpperCAmelCase         =					[
          """safety_checker/pytorch_model.fp16.bin""",
          """safety_checker/model.fp16.safetensors""",
          """vae/diffusion_pytorch_model.fp16.bin""",
          """vae/diffusion_pytorch_model.fp16.safetensors""",
          """text_encoder/pytorch_model.fp16.bin""",
          # 'text_encoder/model.fp16.safetensors',
          """unet/diffusion_pytorch_model.fp16.bin""",
          """unet/diffusion_pytorch_model.fp16.safetensors""",
      ]
      _UpperCAmelCase         =					"""fp16"""
      self.assertFalse(is_safetensors_compatible(__lowerCAmelCase      , variant=__lowerCAmelCase    )    )

"""simple docstring"""


UpperCAmelCase__     						=  [
    [0, 1_6, 1_3, 0, 0, 0],
    [0, 0, 1_0, 1_2, 0, 0],
    [0, 4, 0, 0, 1_4, 0],
    [0, 0, 9, 0, 0, 2_0],
    [0, 0, 0, 7, 0, 4],
    [0, 0, 0, 0, 0, 0],
]






def 			__UpperCAmelCase    (	lowercase      ,lowercase      ,lowercase      ,lowercase						):







  """simple docstring"""
  # Return True if there is node that has not iterated.
  _UpperCAmelCase         =					[False] * len(lowercase						)
  _UpperCAmelCase         =					[s]
  _UpperCAmelCase         =					True

  while queue:
    _UpperCAmelCase         =					queue.pop(0						)
    for ind in range(len(graph[u]						)						):
      if visited[ind] is False and graph[u][ind] > 0:
        queue.append(lowercase						)
        _UpperCAmelCase         =					True
        _UpperCAmelCase         =					u

  return visited[t]






def 			__UpperCAmelCase    (	lowercase      ,lowercase      ,lowercase						):







  """simple docstring"""
  _UpperCAmelCase         =					[-1] * (len(lowercase						))
  _UpperCAmelCase         =					0
  _UpperCAmelCase         =					[]
  _UpperCAmelCase         =					[i[:] for i in graph]  # Record original cut, copy.
  while bfs(lowercase      ,lowercase      ,lowercase      ,lowercase						):
    _UpperCAmelCase         =					float("""Inf"""						)
    _UpperCAmelCase         =					sink

    while s != source:
      # Find the minimum value in select path
      _UpperCAmelCase         =					min(lowercase      ,graph[parent[s]][s]						)
      _UpperCAmelCase         =					parent[s]

    max_flow += path_flow
    _UpperCAmelCase         =					sink

    while v != source:
      _UpperCAmelCase         =					parent[v]
      graph[u][v] -= path_flow
      graph[v][u] += path_flow
      _UpperCAmelCase         =					parent[v]

  for i in range(len(lowercase						)						):
    for j in range(len(graph[0]						)						):
      if graph[i][j] == 0 and temp[i][j] > 0:
        res.append((i, j)						)

  return res


if __name__ == "__main__":
    print(mincut(test_graph, source=0, sink=5))
