code: def set_from_node_to_key(node_attr: str, key: str) -> Callable:
      def extract_from_node(
          context: TransformContext,
      ) -> TransformContext:
          context.output[key] = getattr(context.node, node_attr)
          return context
  
      return extract_from_node
  
file_path: PySyft/packages/syft/src/syft/service/settings/migrations.py
imports: from typing import Callable
  from ...types.syft_migration import migrate
  from ...types.transforms import TransformContext
  from ...types.transforms import drop
  from .settings import NodeSettings
  from .settings import NodeSettingsV2
label_desc: Use image node_id 1 for calling a global function with example usage: set_from_node_to_key(node_attr, key) and returns: extract_from_node, context