code: def data_mapping_as_kwargs(args, kwargs):
      """
      Return kwargs with the mapping and data values
  
      Parameters
      ----------
      args : tuple
          Arguments to [](`~plotnine.geoms.geom`) or
          [](`~plotnine.stats.stat`).
      kwargs : dict
          Keyword arguments to [](`~plotnine.geoms.geom`) or
          [](`~plotnine.stats.stat`).
  
      Returns
      -------
      out : dict
          kwargs that includes 'data' and 'mapping' keys.
      """
      data, mapping = order_as_data_mapping(*args)
  
      # check kwargs #
      if mapping is not None:
          if "mapping" in kwargs:
              raise PlotnineError("More than one mapping argument.")
          else:
              kwargs["mapping"] = mapping
      else:
          if "mapping" not in kwargs:
              mapping = aes()
  
      if kwargs.get("mapping", None) is None:
          kwargs["mapping"] = mapping
  
      if data is not None and "data" in kwargs:
          raise PlotnineError("More than one data argument.")
      elif "data" not in kwargs:
          kwargs["data"] = data
  
      duplicates = set(kwargs["mapping"]) & set(kwargs)
      if duplicates:
          msg = "Aesthetics {} specified two times."
          raise PlotnineError(msg.format(duplicates))
      return kwargs
  
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 26 for calling a global function with example usage: data_mapping_as_kwargs(args, kwargs) and returns: kwargs