code: def _wrap_categorical_plot(func, func_name):
      """
      Wrapper for categorical, x and y may be optional
      """
  
      def f(self, y=None, x=None, *args, **kwargs):
          if x is not None and y is None:
              y = self._maybe_target_name(y, key="y")
  
          elif x is None and y is not None:
              x = self._maybe_target_name(x, key="x")
          return func(x, y, data=self._df, *args, **kwargs)
  
      f.__doc__ = (
          """
          Call ``%s`` using automatic mapping. If you omit x
  
  
          - ``data``: ``ModelFrame``
          - ``x``: ``ModelFrame.target_name``
          """
          % func_name
      )
      return f
  
imports: import pandas
  from pandas_ml.core.accessor import _AccessorMethods, _attach_methods
label_desc: Use image node_id 2 for calling a global function with example usage: _wrap_categorical_plot(func, func_name) and returns: f, func