Get queueing info of the task.
        Note that time between two calls should larger than 30 seconds, otherwise empty dict is returned.

        :param task_name: name of the task
        :return: quota info in dict format
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)
1262209
def print_task_help(self, task, name):
        
        TerminalColor.set('GREEN')
        print(get_signature(name, task))

        # TODO: print the location does not work properly and sometimes returns None
        # print('    => defined in: {}'.format(inspect.getsourcefile(task)))
        help_msg = inspect.getdoc(task) or ''
        TerminalColor.reset()
        print('   ' + help_msg.replace('\n', '\n   '))
        TerminalColor.reset()
        print()
478303
def getTaskHelp(_Task):
  
  """
  Ret = []

  for k in ['name', 'desc']:
    v = _Task.Config.get(k)

    if v is not None:
      Ret.append('%s: %s' % (k, v))

  Args = _Task.Args

  if Args:
    Ret.append('\nArgs:')

    for argName, Arg in Args.items():
      Ret.append('  %s: %s' % (argName, Arg.get('desc', Arg['type_str'])))

    Ret.append('')

  return '\n'.join(Ret).rstrip()
263896
def get_queue(name='default', default_timeout=None, is_async=None,
              autocommit=None, connection=None, queue_class=None, job_class=None, **kwargs):
    
    from .settings import QUEUES

    if kwargs.get('async') is not None:
        is_async = kwargs['async']
        warnings.warn('The `async` keyword is deprecated. Use `is_async` instead', DeprecationWarning)

    # If is_async is provided, use it, otherwise, get it from the configuration
    if is_async is None:
        is_async = QUEUES[name].get('ASYNC', True)
    # same for job_class
    job_class = get_job_class(job_class)

    if default_timeout is None:
        default_timeout = QUEUES[name].get('DEFAULT_TIMEOUT')
    if connection is None:
        connection = get_connection(name)
    queue_class = get_queue_class(QUEUES[name], queue_class)
    return queue_class(name, default_timeout=default_timeout,
                       connection=connection, is_async=is_async,
                       job_class=job_class, autocommit=autocommit, **kwargs)
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)])
461770
def get_task_cls(cls, name):
        
        task_cls = cls._get_reg().get(name)
        if not task_cls:
            raise TaskClassNotFoundException(cls._missing_task_msg(name))

        if task_cls == cls.AMBIGUOUS_CLASS:
            raise TaskClassAmbigiousException('Task %r is ambiguous' % name)
        return task_cls
823238
def _get_task(name):
	''''''
	matches = [x for x in TASKS if x.match(name)]
	if matches:
		return matches[0]
629789
public static TaskQueue getInstance( ILogger logger, String strQueueName )
  {
    if( strQueueName == null )
    {
      return null;
    }

    TaskQueue taskQueue = QUEUE_MAP.get( strQueueName );
    if( taskQueue == null )
    {
      taskQueue = new TaskQueue( logger, strQueueName );
      QUEUE_MAP.put( strQueueName, taskQueue );
    }

    return taskQueue;
  }
48006
def get_completed_task(self, task, timeout=-1):
        
        self.__wait_task_completion(task, timeout)

        return self.get(task)
53571
def get_expired_tasks(self, key_prefix, time, batch_size, client=None):
        
        result = self._get_expired_tasks(args=[key_prefix, time, batch_size],
                                         client=client)

        # [queue1, task1, queue2, task2] -> [(queue1, task1), (queue2, task2)]
        return list(zip(result[::2], result[1::2]))
222825
def task_config(self, task: Task) -> Any:
        ''''''

        return self.get(task.__class__.__name__)
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
925303
def pop(self, queue_name):
        
        task_id = self.conn.lpop(queue_name)
        data = self.conn.get(task_id)
        self.conn.delete(task_id)
        return data
134932
def GetStatusInformation(self):
    
    status = processing_status.TasksStatus()

    with self._lock:
      status.number_of_abandoned_tasks = len(self._tasks_abandoned)
      status.number_of_queued_tasks = len(self._tasks_queued)
      status.number_of_tasks_pending_merge = (
          len(self._tasks_pending_merge) + len(self._tasks_merging))
      status.number_of_tasks_processing = len(self._tasks_processing)
      status.total_number_of_tasks = self._total_number_of_tasks

    return status
278867
def get_task_summary(self, task_name):
        

        params = {'instancesummary': '', 'taskname': task_name}
        resp = self._client.get(self.resource(), params=params)

        map_reduce = resp.json().get('Instance')
        if map_reduce:
            json_summary = map_reduce.get('JsonSummary')
            if json_summary:
                summary = Instance.TaskSummary(json.loads(json_summary))
                summary.summary_text = map_reduce.get('Summary')
                summary.json_summary = json_summary

                return summary
1370622
def Sample(self, tasks_status):
    
    sample_time = time.time()
    sample = '{0:f}\t{1:d}\t{2:d}\t{3:d}\t{4:d}\t{5:d}\n'.format(
        sample_time, tasks_status.number_of_queued_tasks,
        tasks_status.number_of_tasks_processing,
        tasks_status.number_of_tasks_pending_merge,
        tasks_status.number_of_abandoned_tasks,
        tasks_status.total_number_of_tasks)
    self._WritesString(sample)
1236819
def get_task(self, name):
        """"""
        if name in self.tasks.keys():
            task = self.tasks[name]
        else:
            task = Task(name)
            self.tasks[name] = task
        return task