class_docstr: Produces a sequence that's the concatenation of multiple other sequences, without
  copying the elements.
  
  This assumes that the inner sequence never changes. If it does, the results
  are undefined.
class_docstr_tok: ["Produces","a","sequence","that","'s","the","concatenation","of","multiple","other","sequences",",","without","copying","the","elements",".","This","assumes","that","the","inner","sequence","never","changes",".","If","it","does",",","the","results","are","undefined","."]
code: def __getitem__(self, i: Union[int, slice]):
      if isinstance(i, int):
          if i < 0:
              i += len(self)
          if i < 0 or i >= len(self):
              raise IndexError("list index out of range")
          sequence_index = (
              bisect.bisect_right(self.cumulative_sequence_lengths, i)
              - 1
          )
          i -= self.cumulative_sequence_lengths[sequence_index]
          return self.sequences[sequence_index][i]
      else:
          return SlicedSequence(self, i)
  
file_path: allennlp/allennlp/common/sequences.py
imports: import bisect
  import random
  from collections import abc
  from typing import Sequence, Optional, Union
label_desc: Use image node_id 3 for calling the ConcatenatedSequence obj's underlying member method code with example usage: obj.__getitem__(i) and returns: self, SlicedSequence