def execute_and_trace(task_name, *args, **kwargs):
 hostname = kwargs.get('hostname')
 platforms.set_mp_process_title('celeryd', task_name, hostname=hostname)
 try:
  return WorkerTaskTrace(task_name, *args, **kwargs).execute_safe()
 finally:
  platforms.set_mp_process_title('celeryd', '-idle-', hostname)

def execute_and_trace ( task_name , * args , ** kwargs ) : hostname = kwargs . get ( 'hostname' ) platforms . set_mp_process_title ( 'celeryd' , task_name , hostname = hostname ) try : return WorkerTaskTrace ( task_name , * args , ** kwargs ) . execute_safe ( ) finally : platforms . set_mp_process_title ( 'celeryd' , '-idle-' , hostname )
this is a pickleable method used as a target when applying to pools .