genie_x.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:pygenie 作者: Netflix 项目源码 文件源码
def substitute(template, context):
    """
    Performs string substitution.

    Args:
        template (str): The string to perform the substitution on.
        context (dict): A mapping of keys to values for substitution.

    Returns:
        str: The substituted string.
    """

    from string import Template
    template = Template(template)

    return template.safe_substitute(context)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号