def filename(hierarchy, organism):
    """ Obtain a filename for given hierarchy and organism.

    :param hierarchy: GeneSet hierarchy, example: ('GO', 'biological_process')
    :param organism: Taxonomy ID

    :return: Filename for given hierarchy and organism

    Example
    --------
        >>> filename(('CustomSet', 'subsets'), '6500')
        'CustomSet-subsets-6500.gmt'
    """
    return '-'.join(hierarchy + (organism if organism is not None else '',)
        ) + '.gmt'
