Find a matching task for +task_name+.
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
1011701
def num_tasks(self, work_spec_name):
        ''''''
        return self.num_finished(work_spec_name) + \
               self.num_failed(work_spec_name) + \
               self.registry.len(WORK_UNITS_ + work_spec_name)
1373813
def find_template(self, name):
        """"""
        deftemplate = lib.EnvFindDeftemplate(self._env, name.encode())
        if deftemplate == ffi.NULL:
            raise LookupError("Template '%s' not found" % name)

        return Template(self._env, deftemplate)
1238091
function tasks (taskName) {
  var taskList = _.keys(gulp.tasks)

  if (taskName == null) {
    return taskList
  }

  return _.filter(taskList, function (task) {
    return _.startsWith(task, taskName)
  })
}
961940
def get_task(task_id, completed=True):
    
    tasks = get_tasks(task_id=task_id, completed=completed)

    if len(tasks) == 0:
        return None

    assert len(tasks) == 1, 'get_task should return at max 1 task for a task id'
    return tasks[0]
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)
1196337
def load_task(module, task_name, params_str):
    
    if module is not None:
        __import__(module)
    task_cls = Register.get_task_cls(task_name)
    return task_cls.from_str_params(params_str)
677478
def find_tasks(self, overrides):
        """"""
        tasks = self.default_tasks()
        configuration = self.collector.configuration

        for image in list(configuration["images"].keys()):
            path = configuration.path(["images", image, "tasks"], joined="images.{0}.tasks".format(image))
            nxt = configuration.get(path, {})
            tasks.update(nxt)

        if overrides:
            tasks.update(overrides)

        self.tasks = tasks
        return tasks
445694
def find_in_list_by_name(haystack, target_name, target_package, nodetype):
    """"""
    for model in haystack:
        name = model.get('unique_id')
        if id_matches(name, target_name, target_package, nodetype, model):
            return model

    return None
1340617
def get_tasks():
    ''''''
    return {
        name: get_task_queue(name, cls)
        for name, cls in celery.tasks.items()
        # Exclude celery internal tasks
        if not name.startswith('celery.')
        # Exclude udata test tasks
        and not name.startswith('test-')
    }
693258
def get_task(self, key):
        """"""
        res, pk = key
        jobs, lock = self._jobs
        with lock:
            return jobs[res].get(pk)
1093635
def lookup_in_scope(name, scope)
      loop do
        tn = scope.path_with_task_name(name)
        task = @tasks[tn]
        return task if task
        break if scope.empty?
        scope = scope.tail
      end
      nil
    end
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
258207
def do_where(self, taskid: int) -> None:
        """"""
        task = task_by_id(taskid, self._loop)
        if task:
            self._sout.write(_format_stack(task))
            self._sout.write('\n')
        else:
            self._sout.write('No task %d\n' % taskid)
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 []
222825
def task_config(self, task: Task) -> Any:
        ''''''

        return self.get(task.__class__.__name__)
371515
def find_by_task(self, task, params={}, **options): 
        
        path = "/tasks/%s/attachments" % (task)
        return self.client.get_collection(path, params, **options)