def METHOD_NAME(
    index: str, loop_node: Union[nodes.For, nodes.Comprehension]
) -> List[Union[nodes.AssignName, nodes.Name]]:
    """Return a list of <index> AssignName and Name nodes contained in the body of <loop_node>.
    Remove uses of variables that shadow <index>.
    """
    scope = loop_node.scope()
    if isinstance(loop_node, nodes.For):
        body = loop_node
    else:
        body = loop_node.parent
    return [
        name_node
        for name_node in body.nodes_of_class((nodes.AssignName, nodes.Name))
        if name_node.name == index
        and name_node != loop_node.target
        and name_node.lookup(name_node.name)[0] == scope
    ]