code: def test_sample_dims(dim, probs):
      probs = modify_params_using_dims(probs, dim)
      sample = dist.Categorical(probs).sample()
      expected_shape = dist.Categorical(probs).shape()
      assert_equal(sample.size(), expected_shape)
  
imports: from unittest import TestCase
  import numpy
  import pytest
  import scipy.stats
  import torch
  import pyro.distributions
  from tests.common import assert_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test_sample_dims(dim, probs) without return types