code: def _collect_fields(field_parts_list, include_parents):
      
      fields = []
      subpart_lists = defaultdict(list)
  
      for parts in field_parts_list:
          field, subparts = parts[0], parts[1:]
          if subparts:
              if include_parents and field not in fields:
                  fields.append(field)
              subpart_lists[field].append(subparts)
          else:
              fields.append(field)
  
      subfields = dict((field, _collect_fields(subparts, include_parents))
                       for field, subparts in six.iteritems(subpart_lists))
  
      return ParsedFieldList(fields, subfields)
docs: utility function to enable recursion in _parse_field_list()