def METHOD_NAME(spec, environment=None):
  """Evaluates a spec and returns the binding of `net`.
  Specs are written in a DSL based on function composition.  A spec
  like `net = Cr(64, [3, 3])` assigns an object that represents a
  single argument function capable of creating a network to
  the variable `net`.
  Args:
      spec: specification as a string, ending with a `net = ...` statement
      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`
  """
  bindings = eval_spec(spec, environment)
  net = bindings.get("net", None)
  if net is None:
    raise ValueError("spec failed to create 'net': %s" % (spec,))
  return net.funcall