code: def _check_output_format(res, dist, method):
      """Check output format expectations for BaseDistribution tests."""
      if method in METHODS_ROWWISE:
          exp_shape = (dist.shape[0], 1)
      else:
          exp_shape = dist.shape
      assert res.shape == exp_shape
      assert (res.index == dist.index).all()
      if method not in METHODS_ROWWISE:
          assert (res.columns == dist.columns).all()
  
      if method in METHODS_SCALAR_POS or method in METHODS_X_POS:
          assert (res >= 0).all().all()
  
      if isinstance(res, pd.DataFrame):
          assert res.apply(pd.api.types.is_numeric_dtype).all()
      elif isinstance(res, pd.Series):
          assert pd.api.types.is_numeric_dtype(res)
      else:
          raise TypeError("res must be a pandas DataFrame or Series.")
  
imports: import numpy
  import pandas
  import pytest
  from sktime.datatypes import check_is_mtype
  from sktime.tests.test_all_estimators import BaseFixtureGenerator, QuickTester
  from sktime.utils.index import random_ss_ix
label_desc: Use image node_id 2 for calling a global function with example usage: _check_output_format(res, dist, method) without return types