human
Complete the below
def fix_missing_locations(node):

    ''''When you compile a node tree with compile(), the compiler expects lineno and
    col_offset attributes for every node that supports them.  This is rather
    tedious to fill in for generated nodes, so this helper adds these attributes
    recursively where not already set, by setting them to the values of the
    parent node.  It works recursively starting at *node*.'
    '''
 ... Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def _fix(node, lineno, col_offset):
        if ('lineno' in node._attributes):
            if (not hasattr(node, 'lineno')):
                node.lineno = lineno
            else:
                lineno = node.lineno
        if ('col_offset' in node._attributes):
            if (not hasattr(node, 'col_offset')):
                node.col_offset = col_offset
            else:
                col_offset = node.col_offset
        for child in iter_child_nodes(node):
            _fix(child, lineno, col_offset)
    _fix(node, 1, 0)
    return node