def __mul__(self, scalar):
<EOL>if type(scalar) is float:<EOL><INDENT>if scalar < <NUM_LIT:0.0>:<EOL><INDENT>raise Exception(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>result = MaterialPackage(<EOL>self.material, [c * scalar for c in self.compound_masses])<EOL>return result<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>
The multiplication operator (*).

Create a new package by multiplying self with scalar.

:param scalar: The result is a new package with its content equal to
  self multiplied by a scalar, leaving self unchanged.

:returns: A new MaterialPackage equal to self package multiplied by
  other.