code: def _get_fieldnames(item):
          
          if hasattr(item, "_fldsdefprt"): # Is a GOEnrichmentRecord
              return item.get_prtflds_all()
          if hasattr(item, "_fields"): # Is a namedtuple
              return item._fields
docs: Return fieldnames of either a namedtuple or GOEnrichmentRecord.