def __add__(self, other):
<EOL>if type(other) is MaterialPackage:<EOL><INDENT>if self.material == other.material:<EOL><INDENT>result = MaterialPackage(<EOL>self.material,<EOL>self.compound_masses + other.compound_masses)<EOL>return result<EOL><DEDENT>else:  <EOL><INDENT>result = self.clone()<EOL>for compound in other.material.compounds:<EOL><INDENT>if compound not in self.material.compounds:<EOL><INDENT>raise Exception(<EOL>"<STR_LIT>" + other.material.name +<EOL>"<STR_LIT>" +<EOL>self.material.name +<EOL>"<STR_LIT>" + compound +<EOL>"<STR_LIT>" + self.material.name + "<STR_LIT>")<EOL><DEDENT>result += (compound, other.get_compound_mass(compound))<EOL><DEDENT>return result<EOL><DEDENT><DEDENT>elif self._is_compound_mass_tuple(other):<EOL><INDENT>compound = other[<NUM_LIT:0>]<EOL>compound_index = self.material.get_compound_index(compound)<EOL>mass = other[<NUM_LIT:1>]<EOL>result = self.clone()<EOL>result.compound_masses[compound_index] += mass<EOL>return result<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>
Add self and 'other' together, return the result as a new package, and
leave self unchanged.

:param other: Can can be one of the following:
  1. MaterialPackage: 'other' is added to self to create a new package.
  2. tuple: (compound, mass): The specified mass of the specified
  compound is added to self.

:returns: A new Material package that is the sum of self and 'other'.