"""simple docstring"""






_A   					=    [
    [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 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase  ,					__UpperCAmelCase  ,					__UpperCAmelCase  ,					__UpperCAmelCase       )							->   Dict:
				# Return True if there is node that has not iterated.
				SCREAMING_SNAKE_CASE__		  =				[False] * len(__UpperCAmelCase       )
				SCREAMING_SNAKE_CASE__		  =				[s]
				SCREAMING_SNAKE_CASE__		  =				True

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

				return visited[t]




def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase  ,					__UpperCAmelCase  ,					__UpperCAmelCase       )							->   Union[str, Any]:
				SCREAMING_SNAKE_CASE__		  =				[-1] * (len(__UpperCAmelCase       ))
				SCREAMING_SNAKE_CASE__		  =				0
				SCREAMING_SNAKE_CASE__		  =				[]
				SCREAMING_SNAKE_CASE__		  =				[i[:] for i in graph]  # Record original cut, copy.
				while bfs(__UpperCAmelCase  ,					__UpperCAmelCase  ,					__UpperCAmelCase  ,					__UpperCAmelCase       ):
								SCREAMING_SNAKE_CASE__		  =				float("Inf"       )
								SCREAMING_SNAKE_CASE__		  =				sink

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

								max_flow += path_flow
								SCREAMING_SNAKE_CASE__		  =				sink

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

				for i in range(len(__UpperCAmelCase       )       ):
								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))





"""simple docstring"""






import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


_A   					=    ['small', 'medium', 'large']

_A   					=    'lm_head.decoder.weight'
_A   					=    'lm_head.weight'




def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase  ,					__UpperCAmelCase       )							->   List[str]:
				SCREAMING_SNAKE_CASE__		  =				torch.load(__UpperCAmelCase       )
				SCREAMING_SNAKE_CASE__		  =				d.pop(__UpperCAmelCase       )
				os.makedirs(__UpperCAmelCase  ,					exist_ok=__UpperCAmelCase       )
				torch.save(__UpperCAmelCase  ,					os.path.join(__UpperCAmelCase  ,					__UpperCAmelCase       )       )


if __name__ == "__main__":
						_A   					=    argparse.ArgumentParser()
						parser.add_argument('--dialogpt_path', default='.', type=str)
						_A   					=    parser.parse_args()
						for MODEL in DIALOGPT_MODELS:
												_A   					=    os.path.join(args.dialogpt_path, F'{MODEL}_ft.pkl')
												_A   					=    F'./DialoGPT-{MODEL}'
												convert_dialogpt_checkpoint(
												    checkpoint_path,
												    pytorch_dump_folder_path,
												)




