code: def testShiftedSampling(self):
      distribution = shifted_categorical.ShiftedCategorical(
          probs=[0.1, 0.8, 0.1], shift=2
      )
      sample = distribution.sample()
      log_prob = distribution.log_prob(sample)
      results = []
  
      with self.cached_session() as s:
          for _ in range(100):
              value, _ = s.run([sample, log_prob])
              results.append(value)
  
      results = np.array(results, dtype=np.int32)
      self.assertTrue(np.all(results >= 2))
      self.assertTrue(np.all(results <= 4))
  
file_path: agents/tf_agents/distributions/shifted_categorical_test.py
imports: import numpy
  import tensorflow
  import tensorflow_probability
  from tf_agents.distributions import shifted_categorical
label_desc: Use image node_id 2 for calling the ShiftedCategoricalTest obj's underlying member method code with example usage: obj.testShiftedSampling() without return types