def parse_substitution_from_list(list_rep):
    """
    Parse a substitution from the list representation in the config file.
    """
    # We are expecting [pattern, replacement [, is_multiline]]
    if type(list_rep) is not list:
        raise SyntaxError('Substitution must be a list')
    if len(list_rep) < 2:
        raise SyntaxError('Substitution must be a list of size 2')

    pattern = list_rep[0]
    replacement = list_rep[1]

    # By default, substitutions are not multiline.
    is_multiline = False
    if (len(list_rep) > 2):
        is_multiline = list_rep[2]
        if type(is_multiline) is not bool:
            raise SyntaxError('is_multiline must be a boolean')

    result = substitute.Substitution(pattern, replacement, is_multiline)
    return result

    Parse a substitution from the list representation in the config file.
    
eg/config.py