def METHOD_NAME(spec, inputs, environment=None):
  """Evaluates a spec and creates a network instance given the inputs.
  Args:
      spec: specification as a string, ending with a `net = ...` statement
      inputs: input that `net` is applied to
      environment: a dictionary of input bindings
  Returns:
      A callable that instantiates the `net` binding.
  Raises:
      ValueError: spec failed to create a `net`
      Exception: other exceptions raised during execution of `spec`
  """
  return create_net_fun(spec, environment)(inputs)