class_docstr: An OrderedSet is a custom MutableSet that remembers its order, so that
  every entry has an index that can be looked up.
  
  Example:
      >>> OrderedSet([1, 1, 2, 3, 2])
      OrderedSet([1, 2, 3])
class_docstr_tok: ["An","OrderedSet","is","a","custom","MutableSet","that","remembers","its","order",",","so","that","every","entry","has","an","index","that","can","be","looked","up",".","Example",":",">",">",">","OrderedSet","(","[","1",",","1",",","2",",","3",",","2","]",")","OrderedSet","(","[","1",",","2",",","3","]",")"]
docstr: Get the item at a given index.
  
  If `index` is a slice, you will get back that slice of items, as a
  new OrderedSet.
  
  If `index` is a list or a similar iterable, you'll get a list of
  items corresponding to those indices. This is similar to NumPy's
  "fancy indexing". The result is not an OrderedSet because you may ask
  for duplicate indices, and the number of elements returned should be
  the number of elements asked for.
  
  Example:
      >>> oset = OrderedSet([1, 2, 3])
      >>> oset[1]
      2
docstr_tok: ["Get","the","item","at","a","given","index",".","If","`","index","`","is","a","slice",",","you","will","get","back","that","slice","of","items",",","as","a","new","OrderedSet",".","If","`","index","`","is","a","list","or","a","similar","iterable",",","you","'ll","get","a","list","of","items","corresponding","to","those","indices",".","This","is","similar","to","NumPy's","''","fancy","indexing","''",".","The","result","is","not","an","OrderedSet","because","you","may","ask","for","duplicate","indices",",","and","the","number","of","elements","returned","should","be","the","number","of","elements","asked","for",".","Example",":",">",">",">","oset","=","OrderedSet","(","[","1",",","2",",","3","]",")",">",">",">","oset","[","1","]","2"]
code: def __getitem__(self, index):
      """
      Get the item at a given index.
  
      If `index` is a slice, you will get back that slice of items, as a
      new OrderedSet.
  
      If `index` is a list or a similar iterable, you'll get a list of
      items corresponding to those indices. This is similar to NumPy's
      "fancy indexing". The result is not an OrderedSet because you may ask
      for duplicate indices, and the number of elements returned should be
      the number of elements asked for.
  
      Example:
          >>> oset = OrderedSet([1, 2, 3])
          >>> oset[1]
          2
      """
      if isinstance(index, slice) and index == SLICE_ALL:
          return self.copy()
      elif is_iterable(index):
          return [self.items[i] for i in index]
      elif hasattr(index, "__index__") or isinstance(index, slice):
          result = self.items[index]
          if isinstance(result, list):
              return self.__class__(result)
          else:
              return result
      else:
          raise TypeError(
              "Don't know how to index an OrderedSet by %r" % index
          )
  
imports: import itertools
  from collections import deque
label_desc: Use image node_id 3 for calling the OrderedSet obj's underlying member method code with example usage: obj.__getitem__(index) and returns: self, unknown, self, result