nodes: 0, module; 1, function_definition; 2, function_name:intersection_update; 3, parameters; 4, block; 5, identifier:self; 6, list_splat_pattern; 7, expression_statement; 8, for_statement; 9, identifier:others; 10, comment:r"""Update the multiset, keeping only elements found in it and all others.
  
          >>> ms = Multiset('aab')
          >>> ms.intersection_update('bc')
          >>> sorted(ms)
          ['b']
  
          You can also use the ``&=`` operator for the same effect. However, the operator version
          will only accept a set as other operator, not any iterable, to avoid errors.
  
          >>> ms = Multiset('aabc')
          >>> ms &= Multiset('abbd')
          >>> sorted(ms)
          ['a', 'b']
  
          For a variant of the operation which does not modify the multiset, but returns a new
          multiset instead see :meth:`intersection`.
  
          Args:
              others: The other sets to intersect this multiset with. Can also be any :class:`~typing.Iterable`\[~T]
                  or :class:`~typing.Mapping`\[~T, :class:`int`] which are then converted to :class:`Multiset`\[~T].
          """; 11, identifier:other; 12, call; 13, block; 14, identifier:map; 15, argument_list; 16, for_statement; 17, attribute; 18, identifier:others; 19, pattern_list; 20, call; 21, block; 22, identifier:self; 23, identifier:_as_mapping; 24, identifier:element; 25, identifier:current_count; 26, identifier:list; 27, argument_list; 28, expression_statement; 29, if_statement; 30, call; 31, assignment; 32, comparison_operator:multiplicity < current_count; 33, block; 34, attribute; 35, argument_list; 36, identifier:multiplicity; 37, call; 38, identifier:multiplicity; 39, identifier:current_count; 40, expression_statement; 41, identifier:self; 42, identifier:items; 43, attribute; 44, argument_list; 45, assignment; 46, identifier:other; 47, identifier:get; 48, identifier:element; 49, integer:0; 50, subscript; 51, identifier:multiplicity; 52, identifier:self; 53, identifier:element
code: def intersection_update(self, *others):
          r"""Update the multiset, keeping only elements found in it and all others.
  
          >>> ms = Multiset('aab')
          >>> ms.intersection_update('bc')
          >>> sorted(ms)
          ['b']
  
          You can also use the ``&=`` operator for the same effect. However, the operator version
          will only accept a set as other operator, not any iterable, to avoid errors.
  
          >>> ms = Multiset('aabc')
          >>> ms &= Multiset('abbd')
          >>> sorted(ms)
          ['a', 'b']
  
          For a variant of the operation which does not modify the multiset, but returns a new
          multiset instead see :meth:`intersection`.
  
          Args:
              others: The other sets to intersect this multiset with. Can also be any :class:`~typing.Iterable`\[~T]
                  or :class:`~typing.Mapping`\[~T, :class:`int`] which are then converted to :class:`Multiset`\[~T].
          """
          for other in map(self._as_mapping, others):
              for element, current_count in list(self.items()):
                  multiplicity = other.get(element, 0)
                  if multiplicity < current_count:
                      self[element] = multiplicity