def bind(self, **bindings):
    """Creates a new template with the given unbound variables bound.

    Args:
      **bindings: Arguments for every deferred parameter.
    Returns:
      A new template with the given bindings.
    Raises:
      ValueError: If any of the bindings do not correspond to unbound variables.
    """
    new_context = dict(self._partial_context)
    unknown_keys = []
    for k, v in six.iteritems(bindings):
      if k not in self._unbound_vars:
        unknown_keys.append(k)
      new_context[self._unbound_vars[k]] = v
    if unknown_keys:
      raise ValueError(
          'The following keys are not associated with any unbound vars: %s, '
          'legal values are %s' %
          (unknown_keys, list(self._unbound_vars.keys())))
    return _DeferredLayer(self.bookkeeper,
                          None,
                          (),
                          {},
                          scope=self._scope,
                          defaults=self._defaults,
                          pass_through=self,
                          partial_context=new_context)
Creates a new template with the given unbound variables bound.

    Args:
      **bindings: Arguments for every deferred parameter.
    Returns:
      A new template with the given bindings.
    Raises:
      ValueError: If any of the bindings do not correspond to unbound variables.