code: def validate_expressions(expressions):
      if expressions is None:
          return []
  
      if isinstance(expressions, list):
          import logging
  
          logging.warn(
              "Legacy `expressions` format: {}".format(expressions)
          )
          for expr in expressions:
              if isinstance(expr, dict):
                  if not (expr.get("name") and expr.get("expr")):
                      raise PerspectiveError(
                          "Cannot parse dict expression: {}".format(
                              str(expr)
                          )
                      )
              elif not isinstance(expr, str):
                  raise PerspectiveError(
                      "Cannot parse non-string expression: {}".format(
                          str(type(expr))
                      )
                  )
          return expressions
      elif isinstance(expressions, dict):
          for expr in expressions.values():
              if not isinstance(expr, str):
                  raise PerspectiveError(
                      "Cannot parse non-string expression: {}".format(
                          str(type(expr))
                      )
                  )
          return expressions
      else:
          raise PerspectiveError(
              "Cannot parse expressions of type: {}".format(
                  str(type(expressions))
              )
          )
  
file_path: perspective/python/perspective/perspective/viewer/validate.py
imports: from datetime import datetime
  from ..core import ALL_FILTERS, Aggregate, Plugin, Sort
  from ..core.exception import PerspectiveError
label_desc: Use image node_id 9 for calling a global function with example usage: validate_expressions(expressions) and returns: list, expressions, expressions