docstr: Creates a new stage component_desc with :class:`_Component` and uses the decorated function as
  callback.  This will also automatically attach all decorated
  :func:`artifact`\s and :func:`parameter`\s as parameters to the component_desc execution.
  
  The stage name of the component_desc defaults to the name of the function.
  If you want to change that, you can
  pass the intended name as the first argument.
  
  Once decorated the function turns into a :class:`Component` instance
  that can be invoked as a component_desc execution.
docstr_tok: ["Creates","a","new","stage","component_desc","with",":","class",":","`","_Component","`","and","uses","the","decorated","function","as","callback",".","This","will","also","automatically","attach","all","decorated",":","func",":","`","artifact","`","\\s","and",":","func",":","`","parameter","`","\\s","as","parameters","to","the","component_desc","execution",".","The","stage","name","of","the","component_desc","defaults","to","the","name","of","the","function",".","If","you","want","to","change","that",",","you","can","pass","the","intended","name","as","the","first","argument",".","Once","decorated","the","function","turns","into","a",":","class",":","`","Component","`","instance","that","can","be","invoked","as","a","component_desc","execution","."]
code: def stage(
      self,
      roles: List = None,
      name=None,
      provider: Optional[str] = None,
      version: Optional[str] = None,
      description=None,
  ):
      r"""Creates a new stage component_desc with :class:`_Component` and uses the decorated function as
      callback.  This will also automatically attach all decorated
      :func:`artifact`\s and :func:`parameter`\s as parameters to the component_desc execution.
  
      The stage name of the component_desc defaults to the name of the function.
      If you want to change that, you can
      pass the intended name as the first argument.
  
      Once decorated the function turns into a :class:`Component` instance
      that can be invoked as a component_desc execution.
      """
      if roles is None:
          roles = []
  
      def wrap(f):
          sub_cpn = _component(
              name,
              roles or self.roles,
              provider or self.provider,
              version or self.version,
              description,
              True,
          )(f)
          self.stage_components.append(sub_cpn)
          return sub_cpn
  
      return wrap
  
imports: import inspect
  import logging
  from typing import List, Optional
  from fate.components.core.essential import CROSS_VALIDATION, DEFAULT, PREDICT, TRAIN, Role, Stage
  from ._component_artifact import ArtifactDescribeAnnotation, ComponentArtifactDescribes
  from ._parameter import ComponentParameterDescribes, ParameterDescribeAnnotation
label_desc: Use image node_id 12 for calling the Component obj's underlying member method code with example usage: obj.stage(roles, name, provider, version, description) and returns: wrap, sub_cpn