def interpolate_context(command, context):
    """
    Given a single hook command and a dict of context names/values, interpolate the values by
    "{name}" into the command and return the result.
    """
    for name, value in context.items():
        command = command.replace('{%s}' % name, str(value))
    return command
