Get workers from task
        :param task_name: task name
        :param json_obj: json object parsed from get_task_detail2
        :return: list of workers

        .. seealso:: :class:`odps.models.Worker`
357450
def get_task_workers(self, task_name=None, json_obj=None):
        
        if task_name is None and json_obj is None:
            raise ValueError('Either task_name or json_obj should be provided')

        if json_obj is None:
            json_obj = self.get_task_detail2(task_name)
        return WorkerDetail2.extract_from_json(json_obj, client=self._client, parent=self)
1157711
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return TaskQueueInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
            sid=self._solution['sid'],
        )
531452
def get_task_signature(cls, instance, serialized_instance, **kwargs):
        
        cleanup_tasks = [
            ProjectResourceCleanupTask().si(
                core_utils.serialize_class(executor_cls),
                core_utils.serialize_class(model_cls),
                serialized_instance,
            )
            for (model_cls, executor_cls) in cls.executors
        ]

        if not cleanup_tasks:
            return core_tasks.EmptyTask()

        return chain(cleanup_tasks)
540617
def tasks(self, name):
        ''''''
        found = self[name]
        if isinstance(found, Shovel):
            return [v for _, v in found.items()]
        return [found]
1073038
def get_list_subtasks(client, list_id, completed=False):
    '''  '''
    params = {
            'list_id' : int(list_id),
            'completed' : completed,
            }
    response = client.authenticated_request(client.api.Endpoints.SUBTASKS, params=params)
    return response.json()
554533
def help(self, taskname=None):
        

        if not taskname:
            print(inspect.getdoc(self._tasks))
            print()
            print('Available tasks:')
            print()

            for task in self.get_tasks():
                self.print_task_help(task[1], task[0])
        else:
            try:
                task = self.get_task(taskname)
                self.print_task_help(task, task.__name__)

            except TaskNotFound:
                print('Task "%s" not found! Use "ape help" to get usage information.' % taskname)
560659
def get_tasks(self):
        

        def predicate(item):
            return (inspect.isfunction(item) and
                    item.__name__ not in self._helper_names)
        return inspect.getmembers(self._tasks, predicate)
1001519
def common_params(task_instance, task_cls):
    
    if not isinstance(task_cls, task.Register):
        raise TypeError("task_cls must be an uninstantiated Task")

    task_instance_param_names = dict(task_instance.get_params()).keys()
    task_cls_params_dict = dict(task_cls.get_params())
    task_cls_param_names = task_cls_params_dict.keys()
    common_param_names = set(task_instance_param_names).intersection(set(task_cls_param_names))
    common_param_vals = [(key, task_cls_params_dict[key]) for key in common_param_names]
    common_kwargs = dict((key, task_instance.param_kwargs[key]) for key in common_param_names)
    vals = dict(task_instance.get_param_values(common_param_vals, [], common_kwargs))
    return vals
807125
def get_task(name):
    '''
    
    '''
    url = _get_url()

    if version() < '0.13':
        task_url = '{0}/task?name={1}'.format(url, name)
    else:
        task_url = '{0}/kapacitor/v1/tasks/{1}?skip-format=true'.format(url, name)

    response = salt.utils.http.query(task_url, status=True)

    if response['status'] == 404:
        return None

    data = salt.utils.json.loads(response['body'])

    if version() < '0.13':
        return {
            'script': data['TICKscript'],
            'type': data['Type'],
            'dbrps': data['DBRPs'],
            'enabled': data['Enabled'],
        }

    return {
        'script': data['script'],
        'type': data['type'],
        'dbrps': data['dbrps'],
        'enabled': data['status'] == 'enabled',
    }
109349
def get_mesos_task(task_name):
    
    tasks = get_mesos_tasks()

    if tasks is not None:
        for task in tasks:
            if task['name'] == task_name:
                return task
    return None
406612
def get_my_tasks(self, *args):
        

        url = self.build_url(self._endpoints.get('get_my_tasks'))

        response = self.con.get(url)

        if not response:
            return None

        data = response.json()

        return [
            self.task_constructor(parent=self, **{self._cloud_data_key: site})
            for site in data.get('value', [])]
1100662
def tasktiger_processor(logger, method_name, event_dict):
    

    if g['current_tasks'] is not None and not g['current_task_is_batch']:
        event_dict['task_id'] = g['current_tasks'][0].id

    return event_dict
67426
def _worker_method(self):
        
        while not self._should_quit():
            try:
                task = self._inq.get(block=True, timeout=0.25)
            except TypeError:
                if self._should_quit():
                    break
                else:
                    raise
            except Empty:
                continue

            try:
                obj = task.object
                if isinstance(obj, RiakObject):
                    rv = task.client.put(obj, **task.options)
                elif isinstance(obj, TsObject):
                    rv = task.client.ts_put(obj, **task.options)
                else:
                    raise ValueError('unknown obj type: %s'.format(type(obj)))
                task.outq.put(rv)
            except KeyboardInterrupt:
                raise
            except Exception as err:
                errdata = (task.object, err)
                task.outq.put(errdata)
            finally:
                self._inq.task_done()
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
1139636
def _get_task_priority(tasks, task_priority):
    
    if task_priority is None:
        return None
    if is_integer(task_priority):
        return task_priority
    if isinstance(task_priority, basestring):
        if task_priority in tasks:
            return tasks[task_priority].priority

    raise ValueError("Unrecognized task priority '{}'".format(task_priority))
723514
def get_list_info(self, task_name=None):
        
        try:
            tasks = []

            # get all tasks dirs
            tasks_dir = os.path.join(self._paths['base_dir'], 'tasks')

            if task_name:
                # if task folder doesn't exist, return nothing
                if not os.path.isdir(os.path.join(tasks_dir, task_name)):
                    return []

                task_names = [task_name]

            else:
                task_names = [name for name in os.listdir(tasks_dir)
                              if os.path.isdir(os.path.join(tasks_dir, name))]
                task_names.sort()

            for name in task_names:
                try:
                    # parse task config and run option hooks
                    task_config = os.path.join(tasks_dir, name, 'task.cfg')
                    parser_ = parser.parse_config(task_config,
                                                  self.HEADER_TASK_CONFIG)
                    registration.run_option_hooks(parser_,
                                                  disable_missing=False)

                    tasks.append((name, parser_.options, parser_.blocks))

                except (parser.ParseError, errors.InvalidTaskConfig):
                    tasks.append((name, None, None))

            return tasks

        except OSError:
            return []
11209
def [](task_name, scopes=nil)
      task_name = task_name.to_s
      self.lookup(task_name, scopes) or
        enhance_with_matching_rule(task_name) or
        synthesize_file_task(task_name) or
        fail "Don't know how to build task '#{task_name}'"
    end