Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Copy source location (`lineno` and `col_offset` attributes)
from `old_node` to `new_node` if possible, and return `new_node`.

        def copy_location(new_node, old_node):
    """Copy source location (`lineno` and `col_offset` attributes)
    from `old_node` to `new_node` if possible, and return `new_node`.
    """
    for attr in 'lineno', 'col_offset':
        if attr in old_node._attributes and attr in new_node._attributes \
           and hasattr(old_node, attr):
            setattr(new_node, attr, getattr(old_node, attr))
    return new_node
        


src/s/n/SNAKES-0.9.17/snakes/lang/__init__.py   SNAKES(Download)
    def visit_Name (self, node) :
        return ast.copy_location(ast.Name(id=self.map[-1].get(node.id,
                                                              node.id),
                                          ctx=ast.Load()), node)