def running_under_virtualenv():
    if hasattr(sys, 'real_prefix'):
        return True
    elif sys.prefix != getattr(sys, "base_prefix", sys.prefix):
        return True

    return False
Generate a slug for an election.
dataset/ETHPy150Open anzev/hedwig/build/pip/pip/locations.py/running_under_virtualenv--crossover with--dataset/ETHPy150Open openelections/openelections-core/openelex/base/datasource.py/BaseDatasource._election_slug