code: def parse_lookup_expression(element):
      
  
      lookup_grammar = r"""
      lookup = _ "(" range? _ ( "(" _ number _ "," _ number _ ")" _ ","? _ )+ ")"
      number = ("+"/"-")? ~r"\d+\.?\d*(e[+-]\d+)?"
      _ = ~r"[\s\\]*"  # whitespace character
  	range = _ "[" ~r"[^\]]*" "]" _ ","
      """
      parser = parsimonious.Grammar(lookup_grammar)
      tree = parser.parse(element['expr'])
  
      class LookupParser(parsimonious.NodeVisitor):
          def __init__(self, ast):
              self.translation = ""
              self.new_structure = []
              self.visit(ast)
  
          def visit__(self, n, vc):
              # remove whitespace
              return ''
  
          def visit_lookup(self, n, vc):
              pairs = max(vc, key=len)
              mixed_list = pairs.replace('(', '').replace(')', '').split(',')
              xs = mixed_list[::2]
              ys = mixed_list[1::2]
              string = "functions.lookup(x, [%(xs)s], [%(ys)s])" % {
                  'xs': ','.join(xs),
                  'ys': ','.join(ys)
              }
              self.translation = string
  
          def generic_visit(self, n, vc):
              return ''.join(filter(None, vc)) or n.text
  
      parse_object = LookupParser(tree)
      return {'py_expr': parse_object.translation,
              'arguments': 'x'}
docs: This syntax parses lookups that are defined with their own element