code: def get_symbols(node, ctx_types=(ast.Load, ast.Store)):
      """
      Returns all symbols defined in an ast node.
  
      if ctx_types is given, then restrict the symbols to ones with that context.
  
      :param node: ast node
      :param ctx_types: type or tuple of types that may be found assigned to the `ctx` attribute of
                        an ast Name node.
  
      """
      gen = SymbolVisitor(ctx_types)
      return gen.visit(node)
  
file_path: turicreate/src/python/turicreate/meta/asttools/visitors/symbol_visitor.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from ...asttools.visitors import Visitor
  import ast
label_desc: Use image node_id 1 for calling a global function with example usage: get_symbols(node, ctx_types) and returns: gen