code: def process_fig_and_ax_argument(fig, ax, default_figsize=None):
      
      if default_figsize is not None:
          assert type(default_figsize) in [tuple, list]
          assert len(default_figsize) == 2
  
      if (fig is None) and (ax is None):
          fig, ax = plt.subplots(figsize=default_figsize)
      else:
          assert (is_figure(fig)) and (is_axes(ax))
      return fig, ax
docs: Process 'fig' and 'ax' arguments.
  
      'fig' is of type: 'matplotlib.figure.Figure' (or its child object)
      'ax' is of type: 'matplotlib.axes._base._AxesBase' (or its child object)
  
      'fig' and 'ax' should be simultaneously None or of respective proper type.