nodes: 0, module; 1, function_definition; 2, function_name:add; 3, parameters; 4, block; 5, identifier:self; 6, identifier:element; 7, default_parameter; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, expression_statement; 12, identifier:multiplicity; 13, integer:1; 14, comment:"""Adds an element to the multiset.
  
          >>> ms = Multiset()
          >>> ms.add('a')
          >>> sorted(ms)
          ['a']
  
          An optional multiplicity can be specified to define how many of the element are added:
  
          >>> ms.add('b', 2)
          >>> sorted(ms)
          ['a', 'b', 'b']
  
          This extends the :meth:`MutableSet.add` signature to allow specifying the multiplicity.
  
          Args:
              element:
                  The element to add to the multiset.
              multiplicity:
                  The multiplicity i.e. count of elements to add.
          """; 15, comparison_operator:multiplicity < 1; 16, block; 17, augmented_assignment; 18, augmented_assignment; 19, identifier:multiplicity; 20, integer:1; 21, raise_statement; 22, subscript; 23, identifier:multiplicity; 24, attribute; 25, identifier:multiplicity; 26, call; 27, attribute; 28, identifier:element; 29, identifier:self; 30, identifier:_total; 31, identifier:ValueError; 32, argument_list; 33, identifier:self; 34, identifier:_elements; 35, string:"Multiplicity must be positive"
code: def add(self, element, multiplicity=1):
          """Adds an element to the multiset.
  
          >>> ms = Multiset()
          >>> ms.add('a')
          >>> sorted(ms)
          ['a']
  
          An optional multiplicity can be specified to define how many of the element are added:
  
          >>> ms.add('b', 2)
          >>> sorted(ms)
          ['a', 'b', 'b']
  
          This extends the :meth:`MutableSet.add` signature to allow specifying the multiplicity.
  
          Args:
              element:
                  The element to add to the multiset.
              multiplicity:
                  The multiplicity i.e. count of elements to add.
          """
          if multiplicity < 1:
              raise ValueError("Multiplicity must be positive")
          self._elements[element] += multiplicity
          self._total += multiplicity