docstr: Simple utility function to check if a member is inside an interval.
docstr_tok: ["Simple","utility","function","to","check","if","a","member","is","inside","an","interval","."]
code: def assertInterval(self, member, container, msg=None):
      r"""
      Simple utility function to check if a member is inside an interval.
      """
      if isinstance(member, torch.Tensor):
          max_value, min_value = (
              member.max().item(),
              member.min().item(),
          )
      elif isinstance(member, list) or isinstance(member, tuple):
          max_value, min_value = max(member), min(member)
  
      if not isinstance(container, list):
          raise TypeError("container should be a list or tuple")
      elif len(container) != 2:
          raise ValueError("container should have 2 elements")
  
      expected_min, expected_max = container
  
      is_inside_interval = (min_value >= expected_min) and (
          max_value <= expected_max
      )
  
      if not is_inside_interval:
          standardMsg = "%s not found in %s" % (
              safe_repr(member),
              safe_repr(container),
          )
          self.fail(self._formatMessage(msg, standardMsg))
  
imports: import unittest
  from unittest.util import safe_repr
  from transformers import AutoTokenizer, RwkvConfig, is_torch_available
  from transformers.testing_utils import require_torch, slow, torch_device
  from ...generation.test_utils import GenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 2 for calling the RwkvModelTest obj's underlying member method code with example usage: obj.assertInterval(member, container, msg) without return types