human
Solve the following python programming problem given the following code:
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 (goal_scopes.scope and ('.' not in si.scope) and (si.category != ScopeInfo.SUBSYSTEM))]) 
    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, 
}) 

    
    

    Fix the buggy line: goal_scopes = sorted ([si.scope for si in self.context.options.known_scope_to_info.values () if (goal_scopes.scope and ('.' not in si.scope) and (si.category != ScopeInfo.SUBSYSTEM))])
assistant
#Here is Python program to fix the buggy line: goal_scopes = sorted ([si.

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))])