Parse each "Task" in the AST.  This will create self.tasks_dictionary,
        where each task name is a key.

        :return: Creates the self.tasks_dictionary necessary for much of the
        parser.  Returning it is only necessary for unittests.
967139
def create_tasks_dict(self, ast):
        '''
        
        '''
        tasks = self.find_asts(ast, 'Task')
        for task in tasks:
            self.parse_task(task)
        return self.tasks_dictionary
217411
def get_all_tasks(self, subsystem):
        
        with open(os.path.join(self.per_subsystem[subsystem], 'tasks'), 'r') as tasksFile:
            for line in tasksFile:
                yield int(line)
775179
def get_dict_for_mongodb_queries(self):
        
        d = {}
        return d
        # TODO
        all_structures = [task.input.structure for task in self.iflat_tasks()]
        all_pseudos = [task.input.pseudos for task in self.iflat_tasks()]
134106
def parse!
      unless @type.nil? || VALID_TASKS.include?(@type)
        raise TaskList::Exceptions::InvalidTaskTypeError.new type: @type
      end

      @files.each { |f| parsef! file: f }
    end
761614
def tasks(self):
        ''''''
        tasks_response = self.get_request('tasks/')
        return [Task(self, tjson['task']) for tjson in tasks_response]
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
283619
def add_task(self, task, func=None, **kwargs):
        '''  '''
        if not self.__tasks:
            raise Exception("Tasks subparsers is disabled")
        if 'help' not in kwargs:
            if func.__doc__:
                kwargs['help'] = func.__doc__
        task_parser = self.__tasks.add_parser(task, **kwargs)
        if self.__add_vq:
            self.add_vq(task_parser)
        if func is not None:
            task_parser.set_defaults(func=func)
        return task_parser
1014359
def parse_timers(self):
        
        filenames = list(filter(os.path.exists, [task.output_file.path for task in self]))

        parser = AbinitTimerParser()
        parser.parse(filenames)

        return parser
1041981
def get_all_params(cls):
        
        for task_name, task_cls in six.iteritems(cls._get_reg()):
            if task_cls == cls.AMBIGUOUS_CLASS:
                continue
            for param_name, param_obj in task_cls.get_params():
                yield task_name, (not task_cls.use_cmdline_section), param_name, param_obj
755695
def task_search(self, task_str, **kwargs):
        
        self.prune()
        result = collections.defaultdict(dict)
        for task in self._state.get_active_tasks():
            if task.id.find(task_str) != -1:
                serialized = self._serialize_task(task.id, include_deps=False)
                result[task.status][task.id] = serialized
        return result
671741
def compute_tasks(self, **kwargs):
        
        params = self._prebuild(**kwargs)
        if not params:
            params = dict(kwargs)

        return self._build_tasks(**params)
530006
def list_tasks(self):
        
        from highton.models.task import Task

        return fields.ListField(
            name=self.ENDPOINT,
            init_class=Task
        ).decode(
            self.element_from_string(
                self._get_request(
                    endpoint=self.ENDPOINT + '/' + str(self.id) + '/' + Task.ENDPOINT,
                ).text
            )
        )
789123
def find_tasks(lines):
    
    tasks = []
    linenumbers = []
    pattern = re.compile(TASK_PATTERN)
    for n, line in enumerate(lines):
        if "#" in line and "<-" in line:
            m = pattern.match(line)
            if m is not None:
                groupdict = m.groupdict()
                linenumbers.append(n)
                for key in groupdict:
                    groupdict[key] = split_task_parameters(groupdict[key])
                    logging.debug(
                        "{0}: {1}".format(key, ", ".join(groupdict[key])))
                tasks.append(groupdict)
    linenumbers.append(len(lines))
    return tasks, linenumbers
648469
def _group_tasks_by_name_and_status(task_dict):
    
    group_status = {}
    for task in task_dict:
        if task.task_family not in group_status:
            group_status[task.task_family] = []
        group_status[task.task_family].append(task)
    return group_status
1358424
def setup_tasks(self, tasks):
        
        task_classes = []
        for task in tasks:
            category, namespace, name = task.split(".")
            try:
                cls = find_in_registry(category=category, namespace=namespace, name=name)[0]
            except TypeError:
                log.error("Could not find the task with category.namespace.name {0}".format(task))
                raise TypeError
            task_classes.append(cls)
        self.tasks = task_classes
13912
def resolve(self):
        
        values = {}
        for target_name in self.target_names:
            if self.context.is_build_needed(self.parent, target_name):
                self.context.build_task(target_name)

            if len(self.keyword_chain) == 0:
                values[target_name] = self.context.tasks[target_name].value
            else:
                values[target_name] = reduce(
                    lambda task, name: getattr(task, name),
                    self.keyword_chain,
                    self.context.tasks[target_name].task)
        return self.function(**values)
1102422
def tasks_from_nids(self, nids):
        
        if not isinstance(nids, collections.abc.Iterable): nids = [nids]

        n2task = {task.node_id: task for task in self.iflat_tasks()}
        return [n2task[n] for n in nids if n in n2task]