def _run_task_hook(hooks, method, task, queue_name):
 if (hooks is not None):
  try:
   getattr(hooks, method)(task, queue_name)
  except NotImplementedError:
   return False
  return True
 return False

def _run_task_hook ( hooks , method , task , queue_name ) : if ( hooks is not None ) : try : getattr ( hooks , method ) ( task , queue_name ) except NotImplementedError : return False return True return False
invokes hooks .