def get_optimal_thread_count(default=2):
    """Try to guess optimal thread count for current system."""
    try:
        return multiprocessing.cpu_count() + 1
    except __HOLE__:
        # NOTE(harlowja): apparently may raise so in this case we will
        # just setup two threads since it's hard to know what else we
        # should do in this situation.
        return default
dataset/ETHPy150Open openstack/taskflow/taskflow/utils/threading_utils.py/get_optimal_thread_count