def _normalize(data_values, data_errors, base_values, base_errors):
 values = []
 for (value, base) in zip(data_values, base_values):
  try:
   values.append(((100 * (value - base)) / base))
  except ZeroDivisionError:
   values.append((100 * float(cmp(value, base))))
 if data_errors:
  if (not base_errors):
   base_errors = ([0] * len(data_errors))
  errors = []
  for (data, error, base_value, base_error) in zip(data_values, data_errors, base_values, base_errors):
   try:
    errors.append(sqrt(((((error ** 2) * ((100 / base_value) ** 2)) + ((base_error ** 2) * (((100 * data) / (base_value ** 2)) ** 2))) + ((error * base_error) * ((100 / (base_value ** 2)) ** 2)))))
   except ZeroDivisionError:
    errors.append((100 * abs(error)))
 else:
  errors = None
 return (values, errors)

def _normalize ( data_values , data_errors , base_values , base_errors ) : values = [ ] for ( value , base ) in zip ( data_values , base_values ) : try : values . append ( ( ( 100 * ( value - base ) ) / base ) ) except ZeroDivisionError : values . append ( ( 100 * float ( cmp ( value , base ) ) ) ) if data_errors : if ( not base_errors ) : base_errors = ( [ 0 ] * len ( data_errors ) ) errors = [ ] for ( data , error , base_value , base_error ) in zip ( data_values , data_errors , base_values , base_errors ) : try : errors . append ( sqrt ( ( ( ( ( error ** 2 ) * ( ( 100 / base_value ) ** 2 ) ) + ( ( base_error ** 2 ) * ( ( ( 100 * data ) / ( base_value ** 2 ) ) ** 2 ) ) ) + ( ( error * base_error ) * ( ( 100 / ( base_value ** 2 ) ) ** 2 ) ) ) ) ) except ZeroDivisionError : errors . append ( ( 100 * abs ( error ) ) ) else : errors = None return ( values , errors )
normalizes op1 .