def METHOD_NAME(value: StrBytesIntFloat) -> timedelta:
    """
    Parse a duration int/float/string and return a datetime.timedelta.
    The preferred format for durations in Django is '%d %H:%M:%S.%f'.
    Also supports ISO 8601 representation.
    """
    if isinstance(value, timedelta):
        return value
    if isinstance(value, (int, float)):
        # below code requires a string
        value = f'{value:f}'
    elif isinstance(value, bytes):
        value = value.decode()
    try:
        match = standard_duration_re.match(value) or iso8601_duration_re.match(value)
    except TypeError:
        raise TypeError('invalid type; expected timedelta, string, bytes, int or float')
    if not match:
        raise errors.DurationError()
    kw = match.groupdict()
    sign = -1 if kw.pop('sign', '+') == '-' else 1
    if kw.get('microseconds'):
        kw['microseconds'] = kw['microseconds'].ljust(6, '0')
    if kw.get('seconds') and kw.get('microseconds') and kw['seconds'].startswith('-'):
        kw['microseconds'] = '-' + kw['microseconds']
    kw_ = {k: float(v) for k, v in kw.items() if v is not None}
    return sign * timedelta(**kw_)