code: def ensure_list_spec(term: list[str] | str) -> list[str]:
      """
      Convert a str specification to a list spec
  
      e.g.
      'a' -> ['a']
      'a + b' -> ['a', 'b']
      '.' -> []
      '' -> []
      """
      if isinstance(term, str):
          splitter = " + " if " + " in term else "+"
          if term in [".", ""]:
              return []
          return [var.strip() for var in term.split(splitter)]
      else:
          return term
  
file_path: plotnine/plotnine/facets/facet_grid.py
imports: from __future__ import annotations
  import typing
  import pandas
  from .._utils import add_margins, cross_join, join_keys, match, ninteraction
  from ..exceptions import PlotnineError
  from .facet import add_missing_facets, combine_vars, eval_facet_vars, facet, layout_null
  from .strips import Strips, strip
label_desc: Use image node_id 2 for calling a global function with example usage: ensure_list_spec(term) and returns: unknown, term, list