class_docstr: Produces a shuffled view of a sequence, such as a list.
  
  This assumes that the inner sequence never changes. If it does, the results
  are undefined.
class_docstr_tok: ["Produces","a","shuffled","view","of","a","sequence",",","such","as","a","list",".","This","assumes","that","the","inner","sequence","never","changes",".","If","it","does",",","the","results","are","undefined","."]
code: def __init__(
      self,
      inner_sequence: Sequence,
      indices: Optional[Sequence[int]] = None,
  ):
      self.inner = inner_sequence
      self.indices: Sequence[int]
      if indices is None:
          self.indices = list(range(len(inner_sequence)))
          random.shuffle(self.indices)
      else:
          self.indices = indices
  
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 1 to create a new ShuffledSequence object from inherited base classes: abc with example: obj = ShuffledSequence(inner_sequence, indices)