<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clean_path_element(text, max_length=None, separator='_'):
 """ Replace characters that conflict with a free OS choice when in a file system path. :param text: the string to be cleaned :param max_length: the maximum length of the output string :param separator: the separator used for rafcon.core.storage.storage.limit_text_max_length :return: """

    elements_to_replace = REPLACED_CHARACTERS_FOR_NO_OS_LIMITATION
    for elem, replace_with in elements_to_replace.items():
        text = text.replace(elem, replace_with)
    if max_length is not None:
        text = limit_text_max_length(text, max_length, separator)
    return text