code: def unmodified_isinstance(*bases):
      
      class UnmodifiedIsInstance(type):
          if sys.version_info[0] == 2 and sys.version_info[1] <= 6:
  
              @classmethod
              def __instancecheck__(cls, instance):
                  if cls.__name__ in (str(base.__name__) for base in bases):
                      return isinstance(instance, bases)
  
                  subclass = getattr(instance, '__class__', None)
                  subtype = type(instance)
                  instance_type = getattr(abc, '_InstanceType', None)
                  if not instance_type:
                      class test_object:
                          pass
                      instance_type = type(test_object)
                  if subtype is instance_type:
                      subtype = subclass
                  if subtype is subclass or subclass is None:
                      return cls.__subclasscheck__(subtype)
                  return (cls.__subclasscheck__(subclass) or cls.__subclasscheck__(subtype))
          else:
              @classmethod
              def __instancecheck__(cls, instance):
                  if cls.__name__ in (str(base.__name__) for base in bases):
                      return isinstance(instance, bases)
  
                  return type.__instancecheck__(cls, instance)
  
      return with_metaclass(UnmodifiedIsInstance, *bases)
docs: When called in the form
  
      MyOverrideClass(unmodified_isinstance(BuiltInClass))
  
      it allows calls against passed in built in instances to pass even if there not a subclass