docstr: Test that the content of the sampling are valid.
docstr_tok: ["Test","that","the","content","of","the","sampling","are","valid","."]
code: def test_sample_content(self):
      """Test that the content of the sampling are valid."""
      for buffer_cls in (
          SegmentationBuffer,
          MultiAgentSegmentationBuffer,
      ):
          max_seq_len = 5
          max_ep_len = 200
          capacity = 1
          obs_dim = 11
          act_dim = 1
  
          buffer = buffer_cls(capacity, max_seq_len, max_ep_len)
  
          # generate single episode and add to buffer
          episode = _generate_episode_batch(
              max_ep_len, 123, obs_dim, act_dim
          )
          buffer.add(episode)
  
          # sample twice and make sure they are not equal.
          # with a 200 max_ep_len and 200 samples, the probability that the two
          # samples are equal by chance is (1/200)**200 which is basically zero.
          sample1 = _as_sample_batch(buffer.sample(200))
          sample2 = _as_sample_batch(buffer.sample(200))
          _assert_sample_batch_keys(sample1)
          _assert_sample_batch_keys(sample2)
          _assert_sample_batch_not_equal(sample1, sample2)
  
          # sample and make sure the segments are actual segments of the episode
          batch = _as_sample_batch(buffer.sample(1000))
          _assert_sample_batch_keys(batch)
          for elem in batch.rows():
              _assert_is_segment(SampleBatch(elem), episode)
  
imports: import unittest
  from typing import List, Union
  import numpy
  from rllib_dt.dt.segmentation_buffer import MultiAgentSegmentationBuffer, SegmentationBuffer
  import ray
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID, MultiAgentBatch, SampleBatch, concat_samples
  from ray.rllib.utils import test_utils
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
  from ray.rllib.utils.typing import PolicyID
label_desc: Use image node_id 5 for calling the TestSegmentationBuffer obj's underlying member method code with example usage: obj.test_sample_content() without return types