code: def normalizeInternalObjectType(value, cls, name):
      
      if not isinstance(value, cls):
          raise TypeError("%s must be a %s instance, not %s."
                          % (name, name, type(value).__name__))
      return value
docs: Normalizes an internal object type.
  
      * **value** must be a instance of **cls**.
      * Returned value is the same type as the input value.