def get_description(record, rectype):
    if rectype == 'ensembl':
        desc_spl = [x.split(':') for x in record.description.split()]
        try:
            descix = [ix for ix, x in enumerate(desc_spl) if x[0] == 'description'][0]
        except IndexError:
            return 'NA'
        desc = ' '.join([':'.join(x) for x in desc_spl[descix:]])[12:]
        return desc
    elif rectype == 'swiss':
        desc = []
        for part in record.description.split()[1:]:
            if len(part.split('=')) > 1:
                break
            desc.append(part)
        return ' '.join(desc)