code: def as_fn(self, *binding_order):
      
      if len(binding_order) != len(self.unbound_vars):
        raise ValueError('All vars must be specified.')
      for arg in binding_order:
        if arg not in self.unbound_vars:
          raise ValueError('Unknown binding: %s' % arg)
  
      def func(*args, **kwargs):
        """Constructs a template."""
        if len(binding_order) != len(args):
          raise ValueError('Missing values, expects: %s' % binding_order)
        values = dict(zip(binding_order, args))
        values.update(kwargs)
        return self.construct(**values)
  
      func.__doc__ = _gen_ipython_string(func, binding_order, [], func.__doc__)
      return func
docs: Creates a function by binding the arguments in the given order.
  
      Args:
        *binding_order: The unbound variables. This must include all values.
      Returns:
        A function that takes the arguments of binding_order.
      Raises:
        ValueError: If the bindings are missing values or include unknown values.