code: def is_scalar(val):
      """
      Return whether the given object is a scalar
  
      A scalar is a single object i.e. not a collection therefore
      not iterable. Except strings are scalars.
      """
      return not isinstance(val, Iterable) or isinstance(val, str)
  
imports: from __future__ import annotations
  import inspect
  import itertools
  import warnings
  from collections import defaultdict
  from collections.abc import Iterable, Sequence
  from contextlib import suppress
  from typing import TYPE_CHECKING, cast, overload
  from warnings import warn
  import numpy
  import pandas
  from pandas.core.groupby import DataFrameGroupBy
  from ..exceptions import PlotnineError, PlotnineWarning
  from ..mapping import aes
label_desc: Use image node_id 1 for calling a global function with example usage: is_scalar(val) and returns: unknown