code: def _resolve_index(self, mixed):
          
          if mixed is None:
              return None
  
          if type(mixed) is int or mixed in self.edges:
              return mixed
  
          if isinstance(mixed, str) and mixed in self.named:
              return self.named[mixed]
  
          if mixed in self.nodes:
              return self.nodes.index(mixed)
  
          raise ValueError("Cannot find node matching {!r}.".format(mixed))
docs: Find the index based on various strategies for a node, probably an input or output of chain. Supported
          inputs are indexes, node values or names.