def parse_vector_line(line):
    """
    Takes a line from the .dat file formated according to Bodur style and creates a list of its values.
    E.g., "[10,10,10]" -> [10, 10, 10]

    :param line: string - the line with vector values, e.g., "[10,10,10]" or "[[10,10,10]," if it is the first vector of matrix.
    :return: list with vector elements
    """

    old_line_size = len(line)
    line = line.strip() # sometimes we have trailing spaces
    if (old_line_size != len(line)):
        print(f"WARNING: Spaces at the beginning or at the end of the line are found in the .dat file.")

    line_start = line[:2]
    line_end = line[-2:]
    if line_start == "[[" and line_end == "]]": # vector of the matrix that has only one row, e.g., [[10,10,10]]
        clean_line = line[2:-2]
    elif line_start == "[[": # first vector of matrix, e.g., [[10,10,10],
        clean_line = line[2:-2]
    elif line_end == "],": # vector of matrix, e.g., [10,10,10],
        clean_line = line[1:-2]
    elif line_end == "]]": # last vector of matrix, e.g., [10,10,10]]
        clean_line = line[1:-2]
    else: # vector, e.g., [10,10,10]
        assert(line[0] == "[" and line[-1] == "]")
        clean_line = line[1:-1]

    vector = clean_line.split(",")
    vector_numerical = []
    for element in vector:
        element_numerical = float(element)
        # keep it as integer if it is one
        if element_numerical.is_integer(): element_numerical = int(element)
        vector_numerical.append(element_numerical)

    return vector_numerical