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({
          # We don't use _asdict(), because then .description wouldn't be available.
          'scope_info': si,
          # We do use _asdict() here, so our mustache library can do property expansion.
          '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 '.' in si.scope and si.category != ScopeInfo.SUBSYSTEM])
    # TODO: Make goals Optionable and get their description via their ScopeInfo?
    goal_data = []
    for scope in goal_scopes:
      goal_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/operator `not in` -> `in`