Get task's detail v2

        :param task_name: task name
        :return: the task's detail
        :rtype: list or dict according to the JSON
176383
def get_task_detail2(self, task_name):
        

        from ..compat import json  # fix object_pairs_hook parameter for Py2.6

        params = {'detail': '',
                  'taskname': task_name}

        resp = self._client.get(self.resource(), params=params)
        res = resp.text if six.PY3 else resp.content
        try:
            return json.loads(res, object_pairs_hook=OrderedDict)
        except ValueError:
            return res
26125
public List<TaskDetails> fetchTaskDetails(String cluster, String jobId)
      throws IOException {
    String urlString = String.format("http://%s/api/v1/tasks/%s/%s",
        apiHostname, cluster, jobId);
    return retrieveTaskDetailsFromUrl(urlString);
  }
496417
def get_task_by_ref(self, ref):
        
        response = self.requester.get(
            '/{endpoint}/by_ref?ref={task_ref}&project={project_id}',
            endpoint=Task.endpoint,
            task_ref=ref,
            project_id=self.id
        )
        return Task.parse(self.requester, response.json())
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
1138775
def get_run_details_json(self):
        
        run_details_filename = "run_details.json"
        run_details_json_id = dxpy.find_one_data_object(more_ok=False,zero_ok=True,project=self.dx_project_id,name=run_details_filename)["id"]
        json_data = json.loads(dxpy.open_dxfile(dxid=run_details_json_id).read())
        #dxpy.download_dxfile(show_progress=True,dxid=run_details_json_id,project=self.dx_project_id,filename=output_name)
        return json_data
542264
def task_info
      info = {}

      info[:name] = name
      info[:timestamp] = timestamp.to_s
      info[:investigation] = investigation

      info[:full_comment] = full_comment if full_comment
      info[:arg_names] = arg_names if arg_names.any?
      info[:arg_description] = arg_description if arg_description
      info[:locations] = locations if locations.any?
      info[:sources] = sources if sources.any?

      if prerequisite_tasks.any?
        info[:prerequisite_tasks] = prerequisite_tasks.map do |p|
          p.__send__(:task_info)
        end
      end

      info
    end
1048365
def rq_task(self):
        
        task_path = self.task.split('.')
        module_name = '.'.join(task_path[:-1])
        task_name = task_path[-1]

        module = importlib.import_module(module_name)
        return getattr(module, task_name)
437763
def workflow_get_details(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/getDetails' % object_id, input_params, always_retry=always_retry, **kwargs)
1152938
def get_volume_details(self, volume_name: str) -> dict:
        
        if volume_name not in self.volumes:
            raise RuntimeError('No such volume found: ', volume_name)

        volume = self._client.volumes.get(volume_name)
        return volume.attrs
265549
def log_detail(job_id=None, task_name=None, log_id=None):
        
        jobs = get_jobs()
        job = [job for job in jobs if str(job['job_id']) == job_id][0]
        return render_template('log_detail.html',
                               job=job,
                               task_name=task_name,
                               task=[task for task in job['tasks']
                                     if task['name'] == task_name][0],
                               log_id=log_id)
1307130
def get_task(client, task_id):
    '''  '''
    endpoint = '/'.join([client.api.Endpoints.TASKS, str(task_id)])
    response = client.authenticated_request(endpoint)
    return response.json()
350835
def get_task_quota(self, task_name):
        
        params = OrderedDict([('instancequota', ''), ('taskname', task_name)])
        resp = self._client.get(self.resource(), params=params)
        return json.loads(resp.text)
398985
def _taskdict(task):
    '''
    
    '''
    if task is None:
        task = asyncio.current_task()

    assert task
    taskvars = getattr(task, '_syn_taskvars', None)

    if taskvars is None:
        taskvars = varinit(task)

    return taskvars
853425
def check_task_status_and_id(task_json):
        
        if task_json.get('ImportImageTasks') is not None:
            task = task_json['ImportImageTasks'][0]
        else:
            task = task_json

        current_status = task['Status']
        image_id = task['ImportTaskId']
        if current_status == 'completed':
            print "The import has completed succesfully as ID: {}".format(image_id)
            return False, image_id
        elif current_status == 'deleting':
            print "The import job has been cancelled for some reason"
            return False, None
        elif current_status == 'deleted':
            print "The import job was cancelled"
            return False, None
        else:
            print "The current import job for id {} status is: {}".format(image_id, current_status)
            print "sleeping for 30 seconds"
            time.sleep(30)
            return True, image_id
797303
async def inspect(self, task_id: str) -> Mapping[str, Any]:
        

        response = await self.docker._query_json(
            "tasks/{task_id}".format(task_id=task_id), method="GET"
        )
        return response
629388
def task_family(cls):
        
        if not cls.get_task_namespace():
            return cls.__name__
        else:
            return "{}.{}".format(cls.get_task_namespace(), cls.__name__)
958657
def get_task_results(self):
        

        results = self.get_task_results_without_format()
        if options.tunnel.string_as_binary:
            return compat.OrderedDict([(k, bytes(result)) for k, result in six.iteritems(results)])
        else:
            return compat.OrderedDict([(k, str(result)) for k, result in six.iteritems(results)])