def get_router():
 router = getattr(settings, 'RAPIDSMS_ROUTER', 'rapidsms.router.blocking.BlockingRouter')
 if isinstance(router, string_types):
  try:
   router = import_class(router)()
  except ImportError as e:
   raise ImproperlyConfigured(e)
 return router

def get_router ( ) : router = getattr ( settings , 'RAPIDSMS_ROUTER' , 'rapidsms.router.blocking.BlockingRouter' ) if isinstance ( router , string_types ) : try : router = import_class ( router ) ( ) except ImportError as e : raise ImproperlyConfigured ( e ) return router
return router defined by rapidsms_router setting .