code: def assertinstance(obj, types):
      
      if isinstance(obj, types):
          return obj
      raise TypeError('{} must be instance of {}'.format(obj, types))
docs: Make sure object `obj` is of type `types`. Else, raise TypeError.