code: def test_span_indices_outside_sequence(self):
      sequence_tensor = torch.randn([2, 6, 10])
      indices = torch.LongTensor([[[6, 6], [2, 4]], [[0, 1], [4, 4]]])
  
      with pytest.raises(IndexError):
          extractor = MaxPoolingSpanExtractor(10)
          extractor(sequence_tensor, indices)
  
      indices = torch.LongTensor([[[5, 6], [2, 4]], [[0, 1], [4, 4]]])
  
      with pytest.raises(IndexError):
          extractor = MaxPoolingSpanExtractor(10)
          extractor(sequence_tensor, indices)
  
      indices = torch.LongTensor([[[-1, 0], [2, 4]], [[0, 1], [4, 4]]])
  
      with pytest.raises(IndexError):
          extractor = MaxPoolingSpanExtractor(10)
          extractor(sequence_tensor, indices)
  
file_path: allennlp/tests/modules/span_extractors/max_pooling_span_extractor_test.py
imports: import pytest
  import torch
  from allennlp.common.params import Params
  from allennlp.modules.span_extractors import SpanExtractor
  from allennlp.modules.span_extractors.max_pooling_span_extractor import MaxPoolingSpanExtractor
label_desc: Use image node_id 6 for calling the TestMaxPoolingSpanExtractor obj's underlying member method code with example usage: obj.test_span_indices_outside_sequence() without return types