code: def register_quantity(quantity, name):
      
      x = TypeDefinition(name, (quantity.__class__,), ())
      Validator.types_mapping[name] = x
docs: Register `name` as a type to validate as an instance of class `cls`.