human
Here's a good function header given the following:
I wrote the below code

    downloaded_releases = []
    with Session() as session:
        series = session.query(Series).filter((Series.name == name)).first()
        if (not series):
            raise ValueError((u'Unknown    series    `%s`' % name))
        def remove_entity(entity):
            if (not series.begin):
                series.identified_by = u''
            session.delete(entity)
            log.debug(u'Entity    `%s`    from    series    `%s`    removed    from    database.', identifier, name)
            return [release.title for release in entity.downloaded_releases]
        name_to_parse = u'{}    {}'.format(series.name, identifier)
        parsed = get_plugin_by_name(u'parsing').instance.parse_series(name_to_parse, name=series.name)
        if (not parsed.valid):
            raise ValueError(u'Invalid    identifier    for    series    `{}`:    `{}`'.format(series.name, identifier))
        removed = False
        if parsed.season_pack:
            season = session.query(Season).filter((Season.season == parsed.season)).filter((Season.series_id == series.id)).first()
            if season:
                removed = True
                downloaded_releases = remove_entity(season)
        else:
            episode = session.query(Episode).filter((Episode.season == parsed.season)).filter((Episode.number == parsed.episode)).filter((Episode.series_id == series.id)).first()
            if episode:
                removed = True
                downloaded_releases = remove_entity(episode)
        if (not removed):
            raise ValueError((u'Unknown    identifier    `%s`    for    series    `%s`' % (identifier, name.capitalize())))
    if forget:
        for downloaded_release in downloaded_releases:
            fire_event(u'forget', downloaded_release)

What's a good function header?
assistant
#Here's a good function header.

def remove_series_entity(name, identifier, forget=False):