def _make_subclasshook(cls):
 if isinstance(cls.__extra__, abc.ABCMeta):
  def __extrahook__(cls, subclass):
   _valid_for_check(cls)
   res = cls.__extra__.__subclasshook__(subclass)
   if (res is not NotImplemented):
    return res
   if (cls.__extra__ in getattr(subclass, u'__mro__', ())):
    return True
   for scls in cls.__extra__.__subclasses__():
    if isinstance(scls, GenericMeta):
     continue
    if issubclass(subclass, scls):
     return True
   return NotImplemented
 else:
  def __extrahook__(cls, subclass):
   _valid_for_check(cls)
   if (cls.__extra__ and issubclass(subclass, cls.__extra__)):
    return True
   return NotImplemented
 return classmethod(__extrahook__)

def _make_subclasshook ( cls ) : if isinstance ( cls . __extra__ , abc . ABCMeta ) : def __extrahook__ ( cls , subclass ) : _valid_for_check ( cls ) res = cls . __extra__ . __subclasshook__ ( subclass ) if ( res is not NotImplemented ) : return res if ( cls . __extra__ in getattr ( subclass , u'__mro__' , ( ) ) ) : return True for scls in cls . __extra__ . __subclasses__ ( ) : if isinstance ( scls , GenericMeta ) : continue if issubclass ( subclass , scls ) : return True return NotImplemented else : def __extrahook__ ( cls , subclass ) : _valid_for_check ( cls ) if ( cls . __extra__ and issubclass ( subclass , cls . __extra__ ) ) : return True return NotImplemented return classmethod ( __extrahook__ )
construct a __subclasshook__ callable that incorporates the associated __extra__ class in subclass checks performed against cls .