Instantiate and run the perform method od given task data.

    :param task_cls: task class
    :param task_data: task data
    :type task_data: TaskData
    :return: task's result
334298
def run_task_json(task_cls, task_data):
    
    # TODO what does set_skipping_json do?
    task = instantiate(task_cls)
    task_callable = get_callable(task)
    td = TaskData(task_data)
    td.set_skipping_json(True)
    return task_callable(td)
818362
def _setup_task(self, load):
        

        if not self._task:
            self._task = Task(self._data_dir)

        if load:
            self._task.load()
1307130
def get_task(client, task_id):
    '''  '''
    endpoint = '/'.join([client.api.Endpoints.TASKS, str(task_id)])
    response = client.authenticated_request(endpoint)
    return response.json()
982039
def tasks(self, **kwargs):
        
        tasks_result = self.service.tasks().list(**kwargs).execute()
        return [Task(task) for task in tasks_result.get("items", [])]
129929
def run_task(func):
    

    def _wrapped(*a, **k):
        loop = asyncio.get_event_loop()
        return loop.run_until_complete(func(*a, **k))

    return _wrapped
589915
def runTask(self, task, timeout=None):
        
        # Initialize the task.
        task.initialize(self)

        # Start the task.
        task.start()

        # Lets other threads run
        time.sleep(0)

        # Wait for it to finish.
        res = task.wait(timeout=timeout)

        # Now we're done
        return res
2897
def do_running_tasks(self, arg):
        
        for task in asyncio.Task.all_tasks(loop=self.loop):
            _LOGGING.info(task)
1213941
def task_factory(loop, coro):
    
    task = asyncio.Task(coro, loop=loop)
    if task._source_traceback:  # flake8: noqa
        del task._source_traceback[-1]  # flake8: noqa

    # Share context with new task if possible
    current_task = asyncio.Task.current_task(loop=loop)
    if current_task is not None and hasattr(current_task, 'context'):
        setattr(task, 'context', current_task.context)

    return task
509609
private synchronized void runTask(Task task) {
        if (taskThread == null) {
            taskThread = new TaskThread();
        }
        taskThread.runTask(task);
    }
1085509
def execute(self, env, args):
        

        task_name = args.task_name

        if not env.task.exists(task_name):
            raise errors.TaskNotFound(task_name)

        if env.task.active and task_name == env.task.name:
            raise errors.ActiveTask

        # open in task config in editor
        task_config = env.task.get_config_path(task_name)

        if not _edit_task_config(env, task_config, confirm=True):
            raise errors.FocusError(u'Could not open task config: {0}'
                                    .format(task_config))
465974
def do_some_work(
        self,
        work_dict):
    

    label = "do_some_work"

    log.info(("task - {} - start "
              "work_dict={}")
             .format(label,
                     work_dict))

    ret_data = {
        "job_results": ("some response key={}").format(
                            str(uuid.uuid4()))
    }

    log.info(("task - {} - result={} done")
             .format(
                 ret_data,
                 label))

    return ret_data
14339
def task(self, task_uuid):
        
        request = clearly_pb2.FindTaskRequest(task_uuid=task_uuid)
        task = self._stub.find_task(request)
        if task.uuid:
            ClearlyClient._display_task(task, True, True, True)
        else:
            print(EMPTY)
68010
def get_task_result(self, task_id):
        
        data = {
            'action': 'get_result',
            'id': task_id
        }
        self.__send_pyobj(data)
        task = self.__recv_pyobj()
        return task
934121
def invoke_task(task_string) # :nodoc:
      name, args = parse_task_string(task_string)
      t = self[name]
      t.invoke(*args)
    end
381263
async def run_gen_task(self, container, gentask, newthread = True):
        ""
        e = TaskEvent(self, gen_task = gentask, newthread = newthread)
        await container.wait_for_send(e)
        ev = await TaskDoneEvent.createMatcher(e)
        if hasattr(ev, 'exception'):
            raise ev.exception
        else:
            return ev.result
863224
async def peek(self, task_id):
        

        args = (task_id,)
        res = await self.conn.call(self.__funcs['peek'], args)
        return self._create_task(res.body)
843414
def execute_tasks(tasks,template_path)
      
      if File.exists?(File.expand_path(File.join(template_path,'tasks.rb')))
        load File.expand_path(File.join(template_path,'tasks.rb'))
      end
       
      tasks.each{
        |task|
        
        puts 'Running Task: ' + task
        
        task = replace_tags(task);
        
        options = task.split(', ')
        action = options.slice!(0)
        
        if(Tasks.respond_to?(action))
          Tasks.send action, options.join(', ')
        else
          send action, options.join(', ')
        end
        
      }
                  
    end