def weight_as_number(weight):
 if isinstance(weight, six.string_types):
  try:
   weight = weight_dict[weight.lower()]
  except KeyError:
   weight = 400
 elif (weight in range(100, 1000, 100)):
  pass
 else:
  raise ValueError(u'weight not a valid integer')
 return weight

def weight_as_number ( weight ) : if isinstance ( weight , six . string_types ) : try : weight = weight_dict [ weight . lower ( ) ] except KeyError : weight = 400 elif ( weight in range ( 100 , 1000 , 100 ) ) : pass else : raise ValueError ( u'weight not a valid integer' ) return weight
return the weight property as a numeric value .