def _log_duration(f):
    @wraps(f)
    def new_f(*args, **kwargs):
        start_time = datetime.now()
        val = f(*args, **kwargs)
        end_time = datetime.now()
        logging.debug("Operation took %s", end_time-start_time)
        return val
    return new_f


# Singleton values to eschew None
dataset/ETHPy150Open hvandenb/splunk-elasticsearch/search-elasticsearch/bin/splunklib/binding.py/_log_duration/original