def handler_from_provider(provider_name):
 from inbox.auth import module_registry
 auth_mod = module_registry.get(provider_name)
 if (auth_mod is None):
  info = providers.get(provider_name, None)
  if info:
   provider_type = info.get('type', None)
   if provider_type:
    auth_mod = module_registry.get('generic')
 if (auth_mod is None):
  raise NotSupportedError('Nylas does not support the email provider.')
 auth_handler_class = getattr(auth_mod, auth_mod.AUTH_HANDLER_CLS)
 auth_handler = auth_handler_class(provider_name=provider_name)
 return auth_handler

def handler_from_provider ( provider_name ) : from inbox . auth import module_registry auth_mod = module_registry . get ( provider_name ) if ( auth_mod is None ) : info = providers . get ( provider_name , None ) if info : provider_type = info . get ( 'type' , None ) if provider_type : auth_mod = module_registry . get ( 'generic' ) if ( auth_mod is None ) : raise NotSupportedError ( 'Nylas does not support the email provider.' ) auth_handler_class = getattr ( auth_mod , auth_mod . AUTH_HANDLER_CLS ) auth_handler = auth_handler_class ( provider_name = provider_name ) return auth_handler
return an authentication handler for the given provider .