def process_quantity(self, properties):
quant = Q_(properties[<NUM_LIT:0>])<EOL>if len(properties) > <NUM_LIT:1>:<EOL><INDENT>unc = properties[<NUM_LIT:1>]<EOL>uncertainty = unc.get('<STR_LIT>', False)<EOL>upper_uncertainty = unc.get('<STR_LIT>', False)<EOL>lower_uncertainty = unc.get('<STR_LIT>', False)<EOL>uncertainty_type = unc.get('<STR_LIT>')<EOL>if uncertainty_type == '<STR_LIT>':<EOL><INDENT>if uncertainty:<EOL><INDENT>quant = quant.plus_minus(float(uncertainty), relative=True)<EOL><DEDENT>elif upper_uncertainty and lower_uncertainty:<EOL><INDENT>warn('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>uncertainty = max(float(upper_uncertainty), float(lower_uncertainty))<EOL>quant = quant.plus_minus(uncertainty, relative=True)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>elif uncertainty_type == '<STR_LIT>':<EOL><INDENT>if uncertainty:<EOL><INDENT>uncertainty = Q_(uncertainty)<EOL>quant = quant.plus_minus(uncertainty.to(quant.units).magnitude)<EOL><DEDENT>elif upper_uncertainty and lower_uncertainty:<EOL><INDENT>warn('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>uncertainty = max(Q_(upper_uncertainty), Q_(lower_uncertainty))<EOL>quant = quant.plus_minus(uncertainty.to(quant.units).magnitude)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>return quant<EOL>
Process the uncertainty information from a given quantity and return it