

def _gen_reference(self):

    def get_scope_data(scope):
        ret = []
        for si in ScopeInfoIterator(self.context.options.known_scope_to_info).iterate([scope]):
            help_info = HelpInfoExtracter(si.scope).get_option_scope_help_info_from_parser(self.context.options.get_parser(si.scope))
            ret.append({
                'scope_info': si,
                'help_info': help_info._asdict(),
            })
        return ret
    all_global_data = get_scope_data(GLOBAL_SCOPE)
    global_scope_data = all_global_data[0:1]
    global_subsystem_data = all_global_data[1:]
    goal_scopes = sorted([si.scope for si in self.context.options.known_scope_to_info.values() if (si.scope and ('.' not in si.scope) and (si.category != ScopeInfo.SUBSYSTEM))])
    goal_data = []
    for scope in goal_scopes:
        all_global_data.append({
            'goal': scope,
            'goal_description': Goal.by_name(scope).description,
            'task_data': get_scope_data(scope)[1:],
        })
    self._do_render(self.get_options().pants_reference_template, {
        'global_scope_data': global_scope_data,
        'global_subsystem_data': global_subsystem_data,
        'goal_data': goal_data,
    })

dataset/ETHPy150Open pantsbuild/pants/src/python/pants/backend/docgen/tasks/generate_pants_reference.py GeneratePantsReference._gen_reference/VarMisuse@186/259 `goal_data`->`all_global_data`