def get_log_stream(logger):

    file_stream = None
    log_stream = None
    for handler in logger.handlers:
        if isinstance(handler, logging.FileHandler):
            file_stream = handler.stream
        else:
            log_stream = handler.stream

    if file_stream:
        return file_stream

    return log_stream
Ensure the hash of Python's None is actually a hash of 'null' (since
dataset/ETHPy150Open moonso/genmod/genmod/log.py/get_log_stream--crossover with--dataset/ETHPy150Open ntoll/p4p2p/test/dht/test_crypto.py/TestGetHashFunction.test_get_hash_none