nodes: 0, module; 1, function_definition; 2, function_name:times; 3, parameters; 4, block; 5, identifier:self; 6, identifier:factor; 7, expression_statement; 8, if_statement; 9, if_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, expression_statement; 14, return_statement; 15, comment:"""Return a new set with each element's multiplicity multiplied with the given scalar factor.
  
          >>> ms = Multiset('aab')
          >>> sorted(ms.times(2))
          ['a', 'a', 'a', 'a', 'b', 'b']
  
          You can also use the ``*`` operator for the same effect:
  
          >>> sorted(ms * 3)
          ['a', 'a', 'a', 'a', 'a', 'a', 'b', 'b', 'b']
  
          For a variant of the operation which modifies the multiset in place see
          :meth:`times_update`.
  
          Args:
              factor: The factor to multiply each multiplicity with.
          """; 16, comparison_operator:factor == 0; 17, block; 18, comparison_operator:factor < 0; 19, block; 20, assignment; 21, assignment; 22, identifier:element; 23, identifier:_elements; 24, block; 25, augmented_assignment; 26, identifier:result; 27, identifier:factor; 28, integer:0; 29, return_statement; 30, identifier:factor; 31, integer:0; 32, raise_statement; 33, identifier:result; 34, call; 35, identifier:_elements; 36, attribute; 37, expression_statement; 38, attribute; 39, identifier:factor; 40, call; 41, call; 42, attribute; 43, argument_list; 44, identifier:result; 45, identifier:_elements; 46, augmented_assignment; 47, identifier:result; 48, identifier:_total; 49, attribute; 50, argument_list; 51, identifier:ValueError; 52, argument_list; 53, identifier:self; 54, identifier:__copy__; 55, subscript; 56, identifier:factor; 57, identifier:self; 58, identifier:__class__; 59, string; 60, identifier:_elements; 61, identifier:element; 62, string_content:The factor must no be negative.
code: def times(self, factor):
          """Return a new set with each element's multiplicity multiplied with the given scalar factor.
  
          >>> ms = Multiset('aab')
          >>> sorted(ms.times(2))
          ['a', 'a', 'a', 'a', 'b', 'b']
  
          You can also use the ``*`` operator for the same effect:
  
          >>> sorted(ms * 3)
          ['a', 'a', 'a', 'a', 'a', 'a', 'b', 'b', 'b']
  
          For a variant of the operation which modifies the multiset in place see
          :meth:`times_update`.
  
          Args:
              factor: The factor to multiply each multiplicity with.
          """
          if factor == 0:
              return self.__class__()
          if factor < 0:
              raise ValueError('The factor must no be negative.')
          result = self.__copy__()
          _elements = result._elements
          for element in _elements:
              _elements[element] *= factor
          result._total *= factor
          return result