def pname(name, levels=None):
    """
    Return a prettified taxon name.

    Parameters
    ----------
    name : str
        Taxon name.

    Returns
    -------
    str
        Prettified taxon name.

    Examples
    --------

    .. code:: python3

        import dokdo
        
        dokdo.pname('d__Bacteria;p__Actinobacteriota;c__Actinobacteria;o__Actinomycetales;f__Actinomycetaceae;g__Actinomyces;s__Schaalia_radingae')
        # Will print: 's__Schaalia_radingae'

        dokdo.pname('Unassigned;__;__;__;__;__;__')
        # PWill print: 'Unassigned'

        dokdo.pname('d__Bacteria;__;__;__;__;__;__')
        # Will print: 'd__Bacteria'

        dokdo.pname('d__Bacteria;p__Acidobacteriota;c__Acidobacteriae;o__Bryobacterales;f__Bryobacteraceae;g__Bryobacter;__')
        # Will print: 'g__Bryobacter'

        dokdo.pname('d__Bacteria;p__Actinobacteriota;c__Actinobacteria;o__Actinomycetales;f__Actinomycetaceae;g__Actinomyces;s__Schaalia_radingae', levels=[6,7])
        # Will print: 'g__Actinomyces;s__Schaalia_radingae'
    """
    if levels is None:
        ranks = list(reversed(name.split(';')))
        for i, rank in enumerate(ranks):
            if rank in ['Others', 'Unassigned']:
                return rank
            if rank == '__':
                continue
            if rank.split('__')[1] is '':
                return ranks[i+1] + ';' + rank
            return rank
    else:
        ranks = name.split(';')
        if 'Others' in ranks:
            return 'Others'
        if 'Unassigned' in ranks:
            return 'Unassigned'
        return ';'.join([ranks[x-1] for x in levels])