code: def _getFirstPathExpression(name):
      
      tokens = grammar.parseString(name)
      pathExpression = None
      while pathExpression is None:
          if tokens.pathExpression:
              pathExpression = tokens.pathExpression
          elif tokens.expression:
              tokens = tokens.expression
          elif tokens.call:
              tokens = tokens.call.args[0]
          else:
              break
      return pathExpression
docs: Returns the first metric path in an expression.