code: 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*.
      """
  
      def _fix(node, lineno, col_offset, end_lineno, end_col_offset):
          if "lineno" in node._attributes:
              if not hasattr(node, "lineno"):
                  node.lineno = lineno
              else:
                  lineno = node.lineno
          if "end_lineno" in node._attributes:
              if not hasattr(node, "end_lineno"):
                  node.end_lineno = end_lineno
              else:
                  end_lineno = node.end_lineno
          if "col_offset" in node._attributes:
              if not hasattr(node, "col_offset"):
                  node.col_offset = col_offset
              else:
                  col_offset = node.col_offset
          if "end_col_offset" in node._attributes:
              if not hasattr(node, "end_col_offset"):
                  node.end_col_offset = end_col_offset
              else:
                  end_col_offset = node.end_col_offset
          for child in iter_child_nodes(node):
              _fix(
                  child, lineno, col_offset, end_lineno, end_col_offset
              )
  
      _fix(node, 1, 0, 1, 0)
      return node
  
file_path: catboost/contrib/python/gast/gast/gast.py
imports: import sys
  import ast
  from ast import boolop, cmpop, excepthandler, expr, expr_context, operator
  from ast import slice, stmt, unaryop, mod, AST
  from ast import iter_child_nodes, walk
label_desc: Use image node_id 7 for calling a global function with example usage: fix_missing_locations(node) and returns: node