code: def current_model() -> Optional[Sample]:
      """Get the current model sample in :func:`model_context`.
  
      The sample is supposed to be the same as :attr:`nni.nas.space.ExecutableModelSpace.sample`.
  
      This method is only valid when called inside :func:`model_context`.
      By default, only the execution of :class:`~nni.nas.space.SimplifiedModelSpace` will set the context,
      so that :func:`current_model` is meaningful within the re-instantiation of the model.
  
      Returns
      -------
      Model sample (i.e., architecture dict) before freezing, produced by strategy.
      If not called inside :func:`model_context`, returns None.
      """
      cur = frozen_context.current()
      if cur is None or not cur.get("__arch__"):
          # frozen_context exists but it's not set by arch.
          return None
      cur = copy.copy(cur)
      cur.pop("__arch__")
      return cur
  
imports: import copy
  from typing import Optional
  from nni.mutable import frozen_context, Sample
label_desc: Use image node_id 1 for calling a global function with example usage: current_model() and returns: cur, None