def _find_adapter(registry, ob):
 for t in _get_mro(getattr(ob, '__class__', type(ob))):
  if (t in registry):
   return registry[t]

def _find_adapter ( registry , ob ) : for t in _get_mro ( getattr ( ob , '__class__' , type ( ob ) ) ) : if ( t in registry ) : return registry [ t ]
return an adapter factory for ob from registry .