code: def _get_bin_params_2d(xs, ys, binwidth, bins):
      if isinstance(bins, int):
          bins = [bins, bins]
      if isinstance(binwidth, int) or isinstance(binwidth, float):
          binwidth = [binwidth, binwidth]
      if binwidth is not None or bins is not None or len(xs) == 0:
          return binwidth, bins
      binwidth_x = (max(xs) - min(xs)) / _BINS_DEF
      binwidth_y = (max(ys) - min(ys)) / _BINS_DEF
      binwidth_max = max(binwidth_x, binwidth_y)
  
      return [binwidth_max, binwidth_max], bins
  
imports: from ..plot.core import LayerSpec, FeatureSpecArray, aes
  from ..plot.geom import *
  from ..plot.marginal_layer import ggmarginal
label_desc: Use image node_id 1 for calling a global function with example usage: _get_bin_params_2d(xs, ys, binwidth, bins) and returns: list,  bins, binwidth,  bins