





"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowerCAmelCase__   	=	{
    'configuration_funnel': ['FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP', 'FunnelConfig'],
    'convert_funnel_original_tf_checkpoint_to_pytorch': [],
    'tokenization_funnel': ['FunnelTokenizer'],
}

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCAmelCase__   	=	['FunnelTokenizerFast']

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCAmelCase__   	=	[
						    'FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'FunnelBaseModel',
						    'FunnelForMaskedLM',
						    'FunnelForMultipleChoice',
						    'FunnelForPreTraining',
						    'FunnelForQuestionAnswering',
						    'FunnelForSequenceClassification',
						    'FunnelForTokenClassification',
						    'FunnelModel',
						    'FunnelPreTrainedModel',
						    'load_tf_weights_in_funnel',
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCAmelCase__   	=	[
						    'TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'TFFunnelBaseModel',
						    'TFFunnelForMaskedLM',
						    'TFFunnelForMultipleChoice',
						    'TFFunnelForPreTraining',
						    'TFFunnelForQuestionAnswering',
						    'TFFunnelForSequenceClassification',
						    'TFFunnelForTokenClassification',
						    'TFFunnelModel',
						    'TFFunnelPreTrainedModel',
						]


if TYPE_CHECKING:
						from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
						from .tokenization_funnel import FunnelTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_funnel_fast import FunnelTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_funnel import (
												    FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
												    FunnelBaseModel,
												    FunnelForMaskedLM,
												    FunnelForMultipleChoice,
												    FunnelForPreTraining,
												    FunnelForQuestionAnswering,
												    FunnelForSequenceClassification,
												    FunnelForTokenClassification,
												    FunnelModel,
												    FunnelPreTrainedModel,
												    load_tf_weights_in_funnel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_funnel import (
												    TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFFunnelBaseModel,
												    TFFunnelForMaskedLM,
												    TFFunnelForMultipleChoice,
												    TFFunnelForPreTraining,
												    TFFunnelForQuestionAnswering,
												    TFFunnelForSequenceClassification,
												    TFFunnelForTokenClassification,
												    TFFunnelModel,
												    TFFunnelPreTrainedModel,
												)

else:
						import sys

						lowerCAmelCase__   	=	_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)













"""simple docstring"""
# A Bipartite Graph is a graph whose vertices can be divided into two independent sets,
# U and V such that every edge (u, v) either connects a vertex from U to V or a vertex
# from V to U. In other words, for every edge (u, v), either u belongs to U and v to V,
# or u belongs to V and v to U. We can also say that there is no edge that connects
# vertices of same set.






def 					A__				(			UpperCamelCase       ):
							A		=  [False] * len(UpperCamelCase       )
							A		=  [-1] * len(UpperCamelCase       )

							def dfs(UpperCamelCase					,  UpperCamelCase       ):
														A		=  True
														A		=  c
														for u in graph[v]:
																					if not visited[u]:
																												dfs(UpperCamelCase					,  1 - c       )

							for i in range(len(UpperCamelCase       )       ):
														if not visited[i]:
																					dfs(UpperCamelCase					,  0       )

							for i in range(len(UpperCamelCase       )       ):
														for j in graph[i]:
																					if color[i] == color[j]:
																												return False

							return True


# Adjacency list of graph
_snake_case     :		str       						= {0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: []}
print(check_bipartite_dfs(graph))


