<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_ragged_time_series(filename, dtype=float, delimiter=r'\s+', header=False):
 r"""Utility function for loading in data from a delimited time series annotation file with a variable number of columns. Assumes that column 0 contains time stamps and columns 1 through n contain values. n may be variable from time stamp to time stamp. Examples -------- delimiter='\t') header=True) Parameters filename : str Path to the annotation file dtype : function Data type to apply to values columns. delimiter : str Separator regular expression. By default, lines will be split by any amount of whitespace. header : bool Indicates whether a header row is present or not. By default, assumes no header is present. Returns ------- times : np.ndarray array of timestamps (float) values : list of np.ndarray list of arrays of corresponding values """

    # Initialize empty lists
    times = []
    values = []

    # Create re object for splitting lines
    splitter = re.compile(delimiter)

    if header:
        start_row = 1
    else:
        start_row = 0
    with _open(filename, mode='r') as input_file:
        for row, line in enumerate(input_file, start_row):
            # Split each line using the supplied delimiter
            data = splitter.split(line.strip())
            try:
                converted_time = float(data[0])
            except (TypeError, ValueError) as exe:
                six.raise_from(ValueError("Couldn't convert value {} using {} "
                                          "found at {}:{:d}:\n\t{}".format(
                                            data[0], float.__name__,
                                            filename, row, line)), exe)
            times.append(converted_time)

            # cast values to a numpy array. time stamps with no values are cast
            # to an empty array.
            try:
                converted_value = np.array(data[1:], dtype=dtype)
            except (TypeError, ValueError) as exe:
                six.raise_from(ValueError("Couldn't convert value {} using {} "
                                          "found at {}:{:d}:\n\t{}".format(
                                            data[1:], dtype.__name__,
                                            filename, row, line)), exe)
            values.append(converted_value)

    return np.array(times), values