from dataclasses import dataclass
from typing import Optional

import numpy as np
import torch
import torch.nn as nn

from ..utils import BaseOutput, is_torch_version, randn_tensor
from .attention_processor import SpatialNorm
from .unet_ad_blocks import UNetMidBlockaD, get_down_block, get_up_block

@dataclass
class    snake_case       (   UpperCamelCase_    ):
  lowercase_								=  42




class    snake_case       (   nn.Module    ):




  def __init__(   self  :						List[str]  ,			a_  :						Optional[Any]=3  ,			a_  :						Tuple=3  ,			a_  :						Optional[int]=("DownEncoderBlock2D",)  ,			a_  :						Union[str, Any]=(64,)  ,			a_  :						Optional[int]=2  ,			a_  :						List[Any]=32  ,			a_  :						str="silu"  ,			a_  :						Tuple=True  ,			)->							List[Any]:




       """simple docstring"""
       super().__init__()
       SCREAMING_SNAKE_CASE__					:					int      =		layers_per_block

       SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		torch.nn.Convad(
           a_  ,			block_out_channels[0]  ,			kernel_size=3  ,			stride=1  ,			padding=1  ,			)

       SCREAMING_SNAKE_CASE__					:					Any      =		None
       SCREAMING_SNAKE_CASE__					:					List[Any]      =		nn.ModuleList([]					)

       # down
       SCREAMING_SNAKE_CASE__					:					Optional[int]      =		block_out_channels[0]
       for i, down_block_type in enumerate(a_					):
            SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		output_channel
            SCREAMING_SNAKE_CASE__					:					str      =		block_out_channels[i]
            SCREAMING_SNAKE_CASE__					:					Any      =		i == len(a_					) - 1

            SCREAMING_SNAKE_CASE__					:					int      =		get_down_block(
                a_  ,			num_layers=self.layers_per_block  ,			in_channels=a_  ,			out_channels=a_  ,			add_downsample=not is_final_block  ,			resnet_eps=1e-6  ,			downsample_padding=0  ,			resnet_act_fn=a_  ,			resnet_groups=a_  ,			attention_head_dim=a_  ,			temb_channels=a_  ,			)
            self.down_blocks.append(a_					)

       # mid
       SCREAMING_SNAKE_CASE__					:					List[Any]      =		UNetMidBlockaD(
           in_channels=block_out_channels[-1]  ,			resnet_eps=1e-6  ,			resnet_act_fn=a_  ,			output_scale_factor=1  ,			resnet_time_scale_shift='default'  ,			attention_head_dim=block_out_channels[-1]  ,			resnet_groups=a_  ,			temb_channels=a_  ,			)

       # out
       SCREAMING_SNAKE_CASE__					:					List[str]      =		nn.GroupNorm(num_channels=block_out_channels[-1]  ,			num_groups=a_  ,			eps=1e-6					)
       SCREAMING_SNAKE_CASE__					:					Dict      =		nn.SiLU()

       SCREAMING_SNAKE_CASE__					:					str      =		2 * out_channels if double_z else out_channels
       SCREAMING_SNAKE_CASE__					:					List[str]      =		nn.Convad(block_out_channels[-1]  ,			a_  ,			3  ,			padding=1					)

       SCREAMING_SNAKE_CASE__					:					Dict      =		False




  def 						__lowercase(   self  :						Optional[int]  ,			a_  :						Optional[Any]					)->							List[str]:




       """simple docstring"""
       SCREAMING_SNAKE_CASE__					:					List[Any]      =		x
       SCREAMING_SNAKE_CASE__					:					str      =		self.conv_in(a_					)

       if self.training and self.gradient_checkpointing:

            def create_custom_forward(a_  :						Dict					):
                 def custom_forward(*a_  :						List[str]					):
                      return module(*a_					)

                 return custom_forward

            # down
            if is_torch_version('>='  ,			'1.11.0'					):
                 for down_block in self.down_blocks:
                      SCREAMING_SNAKE_CASE__					:					Dict      =		torch.utils.checkpoint.checkpoint(
                          create_custom_forward(a_					)  ,			a_  ,			use_reentrant=a_					)
                 # middle
                 SCREAMING_SNAKE_CASE__					:					int      =		torch.utils.checkpoint.checkpoint(
                     create_custom_forward(self.mid_block					)  ,			a_  ,			use_reentrant=a_					)
            else:
                 for down_block in self.down_blocks:
                      SCREAMING_SNAKE_CASE__					:					Any      =		torch.utils.checkpoint.checkpoint(create_custom_forward(a_					)  ,			a_					)
                 # middle
                 SCREAMING_SNAKE_CASE__					:					List[Any]      =		torch.utils.checkpoint.checkpoint(create_custom_forward(self.mid_block					)  ,			a_					)

       else:
            # down
            for down_block in self.down_blocks:
                 SCREAMING_SNAKE_CASE__					:					Dict      =		down_block(a_					)

            # middle
            SCREAMING_SNAKE_CASE__					:					Optional[int]      =		self.mid_block(a_					)

       # post-process
       SCREAMING_SNAKE_CASE__					:					Any      =		self.conv_norm_out(a_					)
       SCREAMING_SNAKE_CASE__					:					List[str]      =		self.conv_act(a_					)
       SCREAMING_SNAKE_CASE__					:					Dict      =		self.conv_out(a_					)

       return sample




class    snake_case       (   nn.Module    ):




  def __init__(   self  :						List[str]  ,			a_  :						str=3  ,			a_  :						List[str]=3  ,			a_  :						Optional[int]=("UpDecoderBlock2D",)  ,			a_  :						Optional[int]=(64,)  ,			a_  :						int=2  ,			a_  :						List[str]=32  ,			a_  :						List[Any]="silu"  ,			a_  :						Optional[Any]="group"  ,			)->							List[str]:




       """simple docstring"""
       super().__init__()
       SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		layers_per_block

       SCREAMING_SNAKE_CASE__					:					Any      =		nn.Convad(
           a_  ,			block_out_channels[-1]  ,			kernel_size=3  ,			stride=1  ,			padding=1  ,			)

       SCREAMING_SNAKE_CASE__					:					Any      =		None
       SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		nn.ModuleList([]					)

       SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		in_channels if norm_type == 'spatial' else None

       # mid
       SCREAMING_SNAKE_CASE__					:					List[Any]      =		UNetMidBlockaD(
           in_channels=block_out_channels[-1]  ,			resnet_eps=1e-6  ,			resnet_act_fn=a_  ,			output_scale_factor=1  ,			resnet_time_scale_shift='default' if norm_type == 'group' else norm_type  ,			attention_head_dim=block_out_channels[-1]  ,			resnet_groups=a_  ,			temb_channels=a_  ,			)

       # up
       SCREAMING_SNAKE_CASE__					:					Tuple      =		list(reversed(a_					)					)
       SCREAMING_SNAKE_CASE__					:					Any      =		reversed_block_out_channels[0]
       for i, up_block_type in enumerate(a_					):
            SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		output_channel
            SCREAMING_SNAKE_CASE__					:					Any      =		reversed_block_out_channels[i]

            SCREAMING_SNAKE_CASE__					:					Optional[int]      =		i == len(a_					) - 1

            SCREAMING_SNAKE_CASE__					:					str      =		get_up_block(
                a_  ,			num_layers=self.layers_per_block + 1  ,			in_channels=a_  ,			out_channels=a_  ,			prev_output_channel=a_  ,			add_upsample=not is_final_block  ,			resnet_eps=1e-6  ,			resnet_act_fn=a_  ,			resnet_groups=a_  ,			attention_head_dim=a_  ,			temb_channels=a_  ,			resnet_time_scale_shift=a_  ,			)
            self.up_blocks.append(a_					)
            SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		output_channel

       # out
       if norm_type == "spatial":
            SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		SpatialNorm(block_out_channels[0]  ,			a_					)
       else:
            SCREAMING_SNAKE_CASE__					:					Any      =		nn.GroupNorm(num_channels=block_out_channels[0]  ,			num_groups=a_  ,			eps=1e-6					)
       SCREAMING_SNAKE_CASE__					:					List[Any]      =		nn.SiLU()
       SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		nn.Convad(block_out_channels[0]  ,			a_  ,			3  ,			padding=1					)

       SCREAMING_SNAKE_CASE__					:					Optional[int]      =		False




  def 						__lowercase(   self  :						Union[str, Any]  ,			a_  :						Union[str, Any]  ,			a_  :						Any=None					)->							Tuple:




       """simple docstring"""
       SCREAMING_SNAKE_CASE__					:					Dict      =		z
       SCREAMING_SNAKE_CASE__					:					int      =		self.conv_in(a_					)

       SCREAMING_SNAKE_CASE__					:					Dict      =		next(iter(self.up_blocks.parameters()					)					).dtype
       if self.training and self.gradient_checkpointing:

            def create_custom_forward(a_  :						str					):
                 def custom_forward(*a_  :						Dict					):
                      return module(*a_					)

                 return custom_forward

            if is_torch_version('>='  ,			'1.11.0'					):
                 # middle
                 SCREAMING_SNAKE_CASE__					:					str      =		torch.utils.checkpoint.checkpoint(
                     create_custom_forward(self.mid_block					)  ,			a_  ,			a_  ,			use_reentrant=a_					)
                 SCREAMING_SNAKE_CASE__					:					Tuple      =		sample.to(a_					)

                 # up
                 for up_block in self.up_blocks:
                      SCREAMING_SNAKE_CASE__					:					List[Any]      =		torch.utils.checkpoint.checkpoint(
                          create_custom_forward(a_					)  ,			a_  ,			a_  ,			use_reentrant=a_					)
            else:
                 # middle
                 SCREAMING_SNAKE_CASE__					:					Optional[int]      =		torch.utils.checkpoint.checkpoint(
                     create_custom_forward(self.mid_block					)  ,			a_  ,			a_					)
                 SCREAMING_SNAKE_CASE__					:					List[Any]      =		sample.to(a_					)

                 # up
                 for up_block in self.up_blocks:
                      SCREAMING_SNAKE_CASE__					:					Dict      =		torch.utils.checkpoint.checkpoint(create_custom_forward(a_					)  ,			a_  ,			a_					)
       else:
            # middle
            SCREAMING_SNAKE_CASE__					:					int      =		self.mid_block(a_  ,			a_					)
            SCREAMING_SNAKE_CASE__					:					Dict      =		sample.to(a_					)

            # up
            for up_block in self.up_blocks:
                 SCREAMING_SNAKE_CASE__					:					Dict      =		up_block(a_  ,			a_					)

        # post-process
       if latent_embeds is None:
            SCREAMING_SNAKE_CASE__					:					Any      =		self.conv_norm_out(a_					)
       else:
            SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		self.conv_norm_out(a_  ,			a_					)
       SCREAMING_SNAKE_CASE__					:					int      =		self.conv_act(a_					)
       SCREAMING_SNAKE_CASE__					:					Tuple      =		self.conv_out(a_					)

       return sample




class    snake_case       (   nn.Module    ):




  def __init__(   self  :						int  ,			a_  :						Optional[Any]  ,			a_  :						Optional[int]  ,			a_  :						List[Any]  ,			a_  :						Any=None  ,			a_  :						Union[str, Any]="random"  ,			a_  :						List[Any]=False  ,			a_  :						List[str]=True					)->							Tuple:




       """simple docstring"""
       super().__init__()
       SCREAMING_SNAKE_CASE__					:					List[Any]      =		n_e
       SCREAMING_SNAKE_CASE__					:					str      =		vq_embed_dim
       SCREAMING_SNAKE_CASE__					:					Tuple      =		beta
       SCREAMING_SNAKE_CASE__					:					Tuple      =		legacy

       SCREAMING_SNAKE_CASE__					:					List[Any]      =		nn.Embedding(self.n_e  ,			self.vq_embed_dim					)
       self.embedding.weight.data.uniform_(-1.0 / self.n_e  ,			1.0 / self.n_e					)

       SCREAMING_SNAKE_CASE__					:					Any      =		remap
       if self.remap is not None:
            self.register_buffer('used'  ,			torch.tensor(np.load(self.remap					)					)					)
            SCREAMING_SNAKE_CASE__					:					Tuple      =		self.used.shape[0]
            SCREAMING_SNAKE_CASE__					:					List[str]      =		unknown_index  # "random" or "extra" or integer
            if self.unknown_index == "extra":
                 SCREAMING_SNAKE_CASE__					:					int      =		self.re_embed
                 SCREAMING_SNAKE_CASE__					:					str      =		self.re_embed + 1
            print(
                F'''Remapping {self.n_e} indices to {self.re_embed} indices. '''
                F'''Using {self.unknown_index} for unknown indices.'''					)
       else:
            SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		n_e

       SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		sane_index_shape




  def 						__lowercase(   self  :						str  ,			a_  :						List[str]					)->							List[Any]:




       """simple docstring"""
       SCREAMING_SNAKE_CASE__					:					int      =		inds.shape
       assert len(a_					) > 1
       SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		inds.reshape(ishape[0]  ,			-1					)
       SCREAMING_SNAKE_CASE__					:					Any      =		self.used.to(a_					)
       SCREAMING_SNAKE_CASE__					:					Any      =		(inds[:, :, None] == used[None, None, ...]).long()
       SCREAMING_SNAKE_CASE__					:					str      =		match.argmax(-1					)
       SCREAMING_SNAKE_CASE__					:					str      =		match.sum(2					) < 1
       if self.unknown_index == "random":
            SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		torch.randint(0  ,			self.re_embed  ,			size=new[unknown].shape					).to(device=new.device					)
       else:
            SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		self.unknown_index
       return new.reshape(a_					)




  def 						__lowercase(   self  :						Dict  ,			a_  :						Union[str, Any]					)->							Dict:




       """simple docstring"""
       SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		inds.shape
       assert len(a_					) > 1
       SCREAMING_SNAKE_CASE__					:					int      =		inds.reshape(ishape[0]  ,			-1					)
       SCREAMING_SNAKE_CASE__					:					Optional[int]      =		self.used.to(a_					)
       if self.re_embed > self.used.shape[0]:  # extra token
            SCREAMING_SNAKE_CASE__					:					str      =		0  # simply set to zero
       SCREAMING_SNAKE_CASE__					:					str      =		torch.gather(used[None, :][inds.shape[0] * [0], :]  ,			1  ,			a_					)
       return back.reshape(a_					)




  def 						__lowercase(   self  :						Union[str, Any]  ,			a_  :						List[str]					)->							str:




       """simple docstring"""
       # reshape z -> (batch, height, width, channel) and flatten
       SCREAMING_SNAKE_CASE__					:					Any      =		z.permute(0  ,			2  ,			3  ,			1					).contiguous()
       SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		z.view(-1  ,			self.vq_embed_dim					)

       # distances from z to embeddings e_j (z - e)^2 = z^2 + e^2 - 2 e * z
       SCREAMING_SNAKE_CASE__					:					Any      =		torch.argmin(torch.cdist(a_  ,			self.embedding.weight					)  ,			dim=1					)

       SCREAMING_SNAKE_CASE__					:					List[str]      =		self.embedding(a_					).view(z.shape					)
       SCREAMING_SNAKE_CASE__					:					Optional[int]      =		None
       SCREAMING_SNAKE_CASE__					:					Optional[int]      =		None

       # compute loss for embedding
       if not self.legacy:
            SCREAMING_SNAKE_CASE__					:					str      =		self.beta * torch.mean((z_q.detach() - z) ** 2					) + torch.mean((z_q - z.detach()) ** 2					)
       else:
            SCREAMING_SNAKE_CASE__					:					int      =		torch.mean((z_q.detach() - z) ** 2					) + self.beta * torch.mean((z_q - z.detach()) ** 2					)

       # preserve gradients
       SCREAMING_SNAKE_CASE__					:					Tuple      =		z + (z_q - z).detach()

       # reshape back to match original input shape
       SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		z_q.permute(0  ,			3  ,			1  ,			2					).contiguous()

       if self.remap is not None:
            SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		min_encoding_indices.reshape(z.shape[0]  ,			-1					)  # add batch axis
            SCREAMING_SNAKE_CASE__					:					List[str]      =		self.remap_to_used(a_					)
            SCREAMING_SNAKE_CASE__					:					List[Any]      =		min_encoding_indices.reshape(-1  ,			1					)  # flatten

       if self.sane_index_shape:
            SCREAMING_SNAKE_CASE__					:					List[Any]      =		min_encoding_indices.reshape(z_q.shape[0]  ,			z_q.shape[2]  ,			z_q.shape[3]					)

       return z_q, loss, (perplexity, min_encodings, min_encoding_indices)




  def 						__lowercase(   self  :						int  ,			a_  :						Dict  ,			a_  :						Tuple					)->							Optional[int]:




       """simple docstring"""
       # shape specifying (batch, height, width, channel)
       if self.remap is not None:
            SCREAMING_SNAKE_CASE__					:					Union[str, Any]      =		indices.reshape(shape[0]  ,			-1					)  # add batch axis
            SCREAMING_SNAKE_CASE__					:					List[str]      =		self.unmap_to_all(a_					)
            SCREAMING_SNAKE_CASE__					:					Any      =		indices.reshape(-1					)  # flatten again

       # get quantized latent vectors
       SCREAMING_SNAKE_CASE__					:					Dict      =		self.embedding(a_					)

       if shape is not None:
            SCREAMING_SNAKE_CASE__					:					List[Any]      =		z_q.view(a_					)
            # reshape back to match original input shape
            SCREAMING_SNAKE_CASE__					:					Tuple      =		z_q.permute(0  ,			3  ,			1  ,			2					).contiguous()

       return z_q




class    snake_case       (   UpperCamelCase_    ):




  def __init__(   self  :						List[str]  ,			a_  :						int  ,			a_  :						Tuple=False					)->							str:




       """simple docstring"""
       SCREAMING_SNAKE_CASE__					:					Any      =		parameters
       SCREAMING_SNAKE_CASE__      ,				SCREAMING_SNAKE_CASE__					:					int      =		torch.chunk(a_  ,			2  ,			dim=1					)
       SCREAMING_SNAKE_CASE__					:					Any      =		torch.clamp(self.logvar  ,			-30.0  ,			20.0					)
       SCREAMING_SNAKE_CASE__					:					int      =		deterministic
       SCREAMING_SNAKE_CASE__					:					Any      =		torch.exp(0.5 * self.logvar					)
       SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		torch.exp(self.logvar					)
       if self.deterministic:
            SCREAMING_SNAKE_CASE__					:					int      =		torch.zeros_like(
                self.mean  ,			device=self.parameters.device  ,			dtype=self.parameters.dtype					)




  def 						__lowercase(   self  :						Optional[int]  ,			a_  :						Optional[torch.Generator] = None					)->							torch.FloatTensor:




       """simple docstring"""
       # make sure sample is on the same device as the parameters and has same dtype
       SCREAMING_SNAKE_CASE__					:					str      =		randn_tensor(
           self.mean.shape  ,			generator=a_  ,			device=self.parameters.device  ,			dtype=self.parameters.dtype					)
       SCREAMING_SNAKE_CASE__					:					Optional[Any]      =		self.mean + self.std * sample
       return x




  def 						__lowercase(   self  :						str  ,			a_  :						Union[str, Any]=None					)->							Any:




       """simple docstring"""
       if self.deterministic:
            return torch.Tensor([0.0]					)
       else:
            if other is None:
                 return 0.5 * torch.sum(torch.pow(self.mean  ,			2					) + self.var - 1.0 - self.logvar  ,			dim=[1, 2, 3]					)
            else:
                 return 0.5 * torch.sum(
                     torch.pow(self.mean - other.mean  ,			2					) / other.var
                     + self.var / other.var
                     - 1.0
                     - self.logvar
                     + other.logvar  ,			dim=[1, 2, 3]  ,			)




  def 						__lowercase(   self  :						Union[str, Any]  ,			a_  :						str  ,			a_  :						Any=[1, 2, 3]					)->							List[str]:




       """simple docstring"""
       if self.deterministic:
            return torch.Tensor([0.0]					)
       SCREAMING_SNAKE_CASE__					:					int      =		np.log(2.0 * np.pi					)
       return 0.5 * torch.sum(logtwopi + self.logvar + torch.pow(sample - self.mean  ,			2					) / self.var  ,			dim=a_					)




  def 						__lowercase(   self  :						Dict					)->							Union[str, Any]:




       """simple docstring"""
       return self.mean








'''simple docstring'''

# Author: OMKAR PATHAK, Nwachukwu Chidiebere

# Use a Python dictionary to construct the graph.
from __future__ import annotations

from pprint import pformat
from typing import Generic, TypeVar

__lowerCAmelCase		     =  TypeVar('''T''')

class       __magic_name__		(       Generic[T]  ):







							def __init__(				self   :			int      ,_UpperCAmelCase   :			bool = True						):
									_a	: dict[T, list[T]]								=				{}  # dictionary of lists
									_a	: Tuple								=				directed







							def 				__lowercase     (				self   :			Union[str, Any]      ,_UpperCAmelCase   :			T      ,_UpperCAmelCase   :			T						):

									if not self.directed:  # For undirected graphs
											# if both source vertex and destination vertex are both present in the
											# adjacency list, add destination vertex to source vertex list of adjacent
											# vertices and add source vertex to destination vertex list of adjacent
											# vertices.
											if source_vertex in self.adj_list and destination_vertex in self.adj_list:
													self.adj_list[source_vertex].append(_UpperCAmelCase						)
													self.adj_list[destination_vertex].append(_UpperCAmelCase						)
											# if only source vertex is present in adjacency list, add destination vertex
											# to source vertex list of adjacent vertices, then create a new vertex with
											# destination vertex as key and assign a list containing the source vertex
											# as it's first adjacent vertex.
											elif source_vertex in self.adj_list:
													self.adj_list[source_vertex].append(_UpperCAmelCase						)
													_a	: Optional[Any]								=				[source_vertex]
											# if only destination vertex is present in adjacency list, add source vertex
											# to destination vertex list of adjacent vertices, then create a new vertex
											# with source vertex as key and assign a list containing the source vertex
											# as it's first adjacent vertex.
											elif destination_vertex in self.adj_list:
													self.adj_list[destination_vertex].append(_UpperCAmelCase						)
													_a	: Union[str, Any]								=				[destination_vertex]
											# if both source vertex and destination vertex are not present in adjacency
											# list, create a new vertex with source vertex as key and assign a list
											# containing the destination vertex as it's first adjacent vertex also
											# create a new vertex with destination vertex as key and assign a list
											# containing the source vertex as it's first adjacent vertex.
											else:
													_a	: Union[str, Any]								=				[destination_vertex]
													_a	: Optional[int]								=				[source_vertex]
									else:  # For directed graphs
											# if both source vertex and destination vertex are present in adjacency
											# list, add destination vertex to source vertex list of adjacent vertices.
											if source_vertex in self.adj_list and destination_vertex in self.adj_list:
													self.adj_list[source_vertex].append(_UpperCAmelCase						)
											# if only source vertex is present in adjacency list, add destination
											# vertex to source vertex list of adjacent vertices and create a new vertex
											# with destination vertex as key, which has no adjacent vertex
											elif source_vertex in self.adj_list:
													self.adj_list[source_vertex].append(_UpperCAmelCase						)
													_a	: int								=				[]
											# if only destination vertex is present in adjacency list, create a new
											# vertex with source vertex as key and assign a list containing destination
											# vertex as first adjacent vertex
											elif destination_vertex in self.adj_list:
													_a	: Tuple								=				[destination_vertex]
											# if both source vertex and destination vertex are not present in adjacency
											# list, create a new vertex with source vertex as key and a list containing
											# destination vertex as it's first adjacent vertex. Then create a new vertex
											# with destination vertex as key, which has no adjacent vertex
											else:
													_a	: Tuple								=				[destination_vertex]
													_a	: str								=				[]

									return self







							def __repr__(				self   :			int						):
									return pformat(self.adj_list						)




