class_docstr: Module level tests for all sktime distributions.
docstr: Test sample expected return.
docstr_tok: ["Test","sample","expected","return","."]
code: def test_sample(self, estimator_instance, shuffled):
      """Test sample expected return."""
      d = estimator_instance
  
      if shuffled:
          d = _shuffle_distr(d)
  
      res = d.sample()
  
      assert d.shape == res.shape
      assert (res.index == d.index).all()
      assert (res.columns == d.columns).all()
  
      res_panel = d.sample(3)
      dummy_panel = pd.concat([res, res, res], keys=range(3))
      assert dummy_panel.shape == res_panel.shape
      assert (res_panel.index == dummy_panel.index).all()
      assert (res_panel.columns == dummy_panel.columns).all()
  
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 1 for calling the TestAllDistributions obj's underlying member method code with example usage: obj.test_sample(estimator_instance, shuffled) without return types