def storage(storage_config, index):
    if 'dict' in storage_config:
        return InMemoryStorage(storage_config['dict'])
    elif 'redis' in storage_config:
        storage_config['redis']['db'] = index
        return RedisStorage(storage_config['redis'])
    elif 'berkeleydb' in storage_config:
        return BerkeleyDBStorage(storage_config['berkeleydb'])
    elif 'leveldb' in storage_config:
        return LevelDBStorage(storage_config['leveldb'])
    else:
        raise ValueError("Only in-memory dictionary, berkeleydb, leveldb, and redis are supported.")
Convert temperature into preferred units for display purposes.
dataset/ETHPy150Open brandonrobertz/SparseLSH/sparselsh/storage.py/storage--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/thermostat/__init__.py/ThermostatDevice._convert_for_display