def convert_to_timeout(value=None, default_value=None,
                       event_factory=threading.Event):
    if value is None:
        value = default_value
    if isinstance(value, (int, float) + six.string_types):
        return Timeout(float(value), event_factory=event_factory)
    elif isinstance(value, Timeout):
        return value
    else:
        raise ValueError("Invalid timeout literal '%s'" % (value))
Converts a given value to a timeout instance (and returns it).
dataset/ETHPy150Open openstack/taskflow/taskflow/types/timing.py/convert_to_timeout