code: def instance_of(cls):
      
      def check(value):
          return (
              isinstance(value, cls),
              u"{value!r} is instance of {actual!s}, required {required!s}".format(
                  value=value,
                  actual=fullyQualifiedName(type(value)),
                  required=fullyQualifiedName(cls),
              ),
          )
      return check
docs: Create an invariant requiring the value is an instance of ``cls``.