def serviced(method):
 @wraps(method)
 def decorator(cls, request, *args, **kwargs):
  service = atcdClient()
  if (service is None):
   raise BadGateway()
  return method(cls, request, service, *args, **kwargs)
 return decorator

def serviced ( method ) : @ wraps ( method ) def decorator ( cls , request , * args , ** kwargs ) : service = atcdClient ( ) if ( service is None ) : raise BadGateway ( ) return method ( cls , request , service , * args , ** kwargs ) return decorator
a decorator to check if the service is available or not .