def fill_pattern(var_list, pattern):
    """
    Replace values in pattern
    var_list has to have 'pattern' and 'value' keys
    pattern is a string with some keys inside
    """
    code = pattern
    for lista in var_list:
        keys = lista.keys()
        assert 'pattern' in keys and 'value' in keys, 'Lista incorrecta en ' + str(
            lista)
        code = code.replace(lista['pattern'], lista['value'])
    return code
