def split_str_on_comma(str):
    """
    This function will split str using comma except
    there is a '\' before it. Meanwhile, '\' if used as
    escaped symbol will be removed.
    example:
    Raw string "hello,world\,hello\\,again\\\,world" will be
    ["hello", "world,hello\", "again\,world"].
    In python format, the str will actually be
    'hello,world\\,hello\\\\,again\\\\\\,world',
    and the list will actually be
    ['hello', 'world,hello\\', 'again\\,world'].
    :param str: input str to parse
    :return: the result list
    """
    length_str = len(str)
    # To check if the current character is escaped.
    is_escaped = False
    result = []
    sub_str = ""
    for i in range(length_str):
        # If this comma is not escaped,
        # separate with this comma.
        if str[i] == "," and not is_escaped:
            # Check if it is an empty string.
            if sub_str:
                result.append(sub_str)
            sub_str = ""
        # If this current character is escaped,
        # it will have no use, and since it is added
        # to sub_str when it is considered as escaped,
        # just continue.
        elif is_escaped:
            is_escaped = False
            continue
        else:
            # If current is escape symbol, and itself is
            # not escaped, put the is_escaped flag to True,
            # and remove this symbol by jumping to next
            # character.
            if str[i] == "\\":
                is_escaped = True
                # Check the string boundary.
                if i < length_str - 1:
                    i = i + 1
            sub_str = sub_str + str[i]
    if sub_str:
        result.append(sub_str)
    return result