code: def one_to_one(graph, nodes):
      
      edges = itertools.chain.from_iterable(graph.values())
      return len(graph) == len(nodes) and len(set(edges)) == len(nodes)
docs: Return True if graph contains only one to one mappings. The
      directed graph should be represented as a dictionary mapping of
      edges for each node. Nodes should be passed a simple list.