<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_fn(self, *binding_order):
 """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. """

    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