class_docstr: Base class for mapping data values to plot attributes.
class_docstr_tok: ["Base","class","for","mapping","data","values","to","plot","attributes","."]
docstr: Input check when values are provided as a list.
docstr_tok: ["Input","check","when","values","are","provided","as","a","list","."]
code: def _check_list_length(self, levels, values, variable):
      """Input check when values are provided as a list."""
      # Copied from _core/properties; eventually will be replaced for that.
      message = ""
      if len(levels) > len(values):
          message = " ".join(
              [
                  f"\nThe {variable} list has fewer values ({len(values)})",
                  f"than needed ({len(levels)}) and will cycle, which may",
                  "produce an uninterpretable plot.",
              ]
          )
          values = [x for _, x in zip(levels, itertools.cycle(values))]
  
      elif len(values) > len(levels):
          message = " ".join(
              [
                  f"The {variable} list has more values ({len(values)})",
                  f"than needed ({len(levels)}), which may not be intended.",
              ]
          )
          values = values[: len(levels)]
  
      if message:
          warnings.warn(message, UserWarning, stacklevel=6)
  
      return values
  
imports: from __future__ import annotations
  import warnings
  import itertools
  from copy import copy
  from collections import UserString
  from collections.abc import Iterable, Sequence, Mapping
  from numbers import Number
  from datetime import datetime
  import numpy
  import pandas
  import matplotlib
  from seaborn._core.data import PlotData
  from seaborn.palettes import QUAL_PALETTES, color_palette
  from seaborn.utils import _check_argument, _version_predates, desaturate, locator_to_legend_entries, get_color_cycle, remove_na
label_desc: Use image node_id 2 for calling the SemanticMapping obj's underlying member method code with example usage: obj._check_list_length(levels, values, variable) and returns: values