def get_surrounding_text(text, sub_start, sub_end=None, distance=25):
    """
    Looks for the substrings, 'sub_start' and 'sub_end' variables in 'text' and return a new substring
    with a number equal to 'distance' characters in the left of 'sub_start' position and in the right of
    'sub_end' position if they exist, if one of them are not found the partition of the string will be until
    the start or until the end of the text variable.
    :param text: a string. The string to look for.
    :param sub_start: a string. The start to get the left and the right parts of the new subtring.
    :param sub_end: an optional string. The start to get the right part of the new substring.
    :param distance: an optional integer. The length of the left and right parts of the new string from sub_start
        and sub_end if they are found. If the substrings are not found, the distance will be to the start of the text
        and the end of the text.
    :return: a string. A new substring with the characters around the 'sub_start' and 'sub-end' substrings.
    """
    surrounding_text = ""
    separators = ['.', '\n', ',']
    i_start = text.lower().find(sub_start.lower())
    i_left = max(0, i_start - distance)
    i_separators = [text[i_left:i_start].find(separator) for separator in separators]
    i_separators = [i + i_left + 1 for i in i_separators if i >= 0]
    if i_separators:
        i_left = max(i_left, *i_separators)
    if sub_end:
        i_end = text.lower().find(sub_end.lower())
    else:
        i_end = -1
        sub_end = sub_start
    if i_end < 0:
        i_end = i_start + len(sub_start)
        i_right = len(text)
    else:
        i_end = i_end + len(sub_end)
        i_right= min(len(text), i_end + distance)
    i_separators = [text[i_end:i_right].find(separator) for separator in separators]
    i_separators = [i + i_end for i in i_separators if i >= 0]
    if i_separators:
        i_right = min(i_right, *i_separators)
    surrounding_text = text[i_left:i_right].strip()
    return surrounding_text