"""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.
from queue import Queue

def 						UpperCamelCase				(	_lowerCAmelCase   :							Optional[int]						):
    __a			      =						Queue()
    __a			      =						[False] * len(_lowerCAmelCase						)
    __a			      =						[-1] * len(_lowerCAmelCase						)

    def bfs():
        while not queue.empty():
            __a			      =						queue.get()
            __a			      =						True

            for neighbour in graph[u]:
                if neighbour == u:
                    return False

                if color[neighbour] == -1:
                    __a			      =						1 - color[u]
                    queue.put(_lowerCAmelCase						)

                elif color[neighbour] == color[u]:
                    return False

        return True

    for i in range(len(_lowerCAmelCase						)						):
        if not visited[i]:
            queue.put(_lowerCAmelCase						)
            __a			      =						0
            if bfs() is False:
                return False

    return True


if __name__ == "__main__":
 # Adjacency List of graph
 print(check_bipartite({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2]}))





def 						_UpperCAmelCase							( snake_case     ):





					"""simple docstring"""

					_lowerCAmelCase         =       str(snake_case     ).strip()
					if not bin_string:
										raise ValueError("""Empty string was passed to the function"""     )
					_lowerCAmelCase         =       bin_string[0] == """-"""
					if is_negative:
										_lowerCAmelCase         =       bin_string[1:]
					if not all(char in """01""" for char in bin_string     ):
										raise ValueError("""Non-binary value was passed to the function"""     )
					_lowerCAmelCase         =       0
					for char in bin_string:
										_lowerCAmelCase         =       2 * decimal_number + int(snake_case     )
					return -decimal_number if is_negative else decimal_number


if __name__ == "__main__":
	from doctest import testmod

	testmod()



