def _resolve_index(self, mixed):
        """
        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.

        """
        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))
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 ) )
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.