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: Update the set with the given iterable sequence, then return the index
  of the last element inserted.
  
  Example:
      >>> oset = OrderedSet([1, 2, 3])
      >>> oset.update([3, 1, 5, 1, 4])
      4
      >>> print(oset)
      OrderedSet([1, 2, 3, 5, 4])
docstr_tok: ["Update","the","set","with","the","given","iterable","sequence",",","then","return","the","index","of","the","last","element","inserted",".","Example",":",">",">",">","oset","=","OrderedSet","(","[","1",",","2",",","3","]",")",">",">",">","oset.update","(","[","3",",","1",",","5",",","1",",","4","]",")","4",">",">",">","print","(","oset",")","OrderedSet","(","[","1",",","2",",","3",",","5",",","4","]",")"]
code: def update(self, sequence):
      """
      Update the set with the given iterable sequence, then return the index
      of the last element inserted.
  
      Example:
          >>> oset = OrderedSet([1, 2, 3])
          >>> oset.update([3, 1, 5, 1, 4])
          4
          >>> print(oset)
          OrderedSet([1, 2, 3, 5, 4])
      """
      item_index = None
      try:
          for item in sequence:
              item_index = self.add(item)
      except TypeError:
          raise ValueError(
              "Argument needs to be an iterable, got %s"
              % type(sequence)
          )
      return item_index
  
imports: import itertools
  from collections import deque
label_desc: Use image node_id 9 for calling the OrderedSet obj's underlying member method code with example usage: obj.update(sequence) and returns: item_index