code: def _get_marginal_def(geom_kind, color_by=None):
      if (
          geom_kind in ["density2d", "density2df"]
          or color_by is not None
      ):
          return "dens:tr"
      else:
          return "hist:tr"
  
imports: from ..plot.core import PlotSpec, aes
  from ..plot.geom import geom_smooth
  from ..plot.label import xlab, ylab
  from ._plot2d_common import _get_bin_params_2d, _get_geom2d_layer, _get_marginal_layers
label_desc: Use image node_id 1 for calling a global function with example usage: _get_marginal_def(geom_kind, color_by) and returns: str, str