def locate_child(self, child):
for field in self._astroid_fields:<EOL><INDENT>node_or_sequence = getattr(self, field)<EOL>if child is node_or_sequence:<EOL><INDENT>return field, child<EOL><DEDENT>if (<EOL>isinstance(node_or_sequence, (tuple, list))<EOL>and child in node_or_sequence<EOL>):<EOL><INDENT>return field, node_or_sequence<EOL><DEDENT><DEDENT>msg = "<STR_LIT>"<EOL>raise exceptions.AstroidError(msg % (repr(child), repr(self)))<EOL>
Find the field of this node that contains the given child.

        :param child: The child node to search fields for.
        :type child: NodeNG

        :returns: A tuple of the name of the field that contains the child,
            and the sequence or node that contains the child node.
        :rtype: tuple(str, iterable(NodeNG) or NodeNG)

        :raises AstroidError: If no field could be found that contains
            the given child.