code: def _validate_pivots(pivots):
      if pivots is None:
          return []
      elif isinstance(pivots, str):
          pivots = [pivots]
  
      if isinstance(pivots, list):
          return pivots
      else:
          raise PerspectiveError(
              "Cannot parse pivots of type: %s", str(type(pivots))
          )
  
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 3 for calling a global function with example usage: _validate_pivots(pivots) and returns: list, pivots