def METHOD_NAME(duration):
    """Returns a time duration (in seconds) representation of the input value
    :param duration: value to format (e.g. 5h30m2s)
    :return: duration in seconds of the input value
    :rtype: float
    """
    if isinstance(duration, int) or isinstance(duration, float):
        return float(duration)
    matches = __seconds_pattern.match(duration)
    result = 0.0
    if matches.group(2):
        result += float(matches.group(2)) * 3600  # hours
    if matches.group(4):
        result += float(matches.group(4)) * 60  # minutes
    if matches.group(5):
        result += float(matches.group(5))  # seconds
    return result