code: def parse_formula(code, extra_operators=[]):
      if not code.strip():
          code = "~ 1"
  
      for op in extra_operators:
          if op.precedence < 0:
              raise ValueError(
                  "all operators must have precedence >= 0"
              )
  
      operators = _default_ops + extra_operators
      operator_strings = [op.token_type for op in operators]
      tree = infix_parse(
          _tokenize_formula(code, operator_strings),
          operators,
          _atomic_token_types,
      )
      if not isinstance(tree, ParseNode) or tree.type != "~":
          tree = ParseNode("~", None, [tree], tree.origin)
      return tree
  
imports: from __future__ import print_function
  import tokenize
  import six
  from six.moves import cStringIO
  from patsy import PatsyError
  from patsy.origin import Origin
  from patsy.infix_parser import Token, Operator, infix_parse, ParseNode
  from patsy.tokens import python_tokenize, pretty_untokenize
  from patsy.util import PushbackAdapter
label_desc: Use image node_id 5 for calling a global function with example usage: parse_formula(code, extra_operators) and returns: tree