code: def coerce(dtype, value):
      
      if dtype is None:
          return value
      if type(value).__name__ == dtype:
          return value
      op = COERCION_RULES[dtype]
      return op() if value is None else op(value)
docs: Convert a value to a specific type.
  
      If the value is already the given type, then the original value is
      returned. If the value is None, then the default value given by the
      type constructor is returned. Otherwise, the type constructor converts
      and returns the value.