def custom_format(template_string, **kwargs):
    """
    The python format uses {...} to indicate the variable that needs to be replaced.
    custom_format uses &lformat ... &rformat to indicate the variable, which means {} can be used in the template_string
    as a normal character.
    """
    template_string = template_string.replace('{', '{{')
    template_string = template_string.replace('}', '}}')
    template_string = template_string.replace('&lformat ', '{')
    template_string = template_string.replace(' &rformat', '}')
    return template_string.format_map(kwargs)