code: def _downgrade_metadata_v3_to_v2() -> Callable:
      def set_defaults_from_settings(
          context: TransformContext,
      ) -> TransformContext:
          # Extract from settings if node is attached to context
          if context.node is not None:
              context.output[
                  "deployed_on"
              ] = context.node.settings.deployed_on
              context.output[
                  "on_board"
              ] = context.node.settings.on_board
              context.output[
                  "signup_enabled"
              ] = context.node.settings.signup_enabled
              context.output[
                  "admin_email"
              ] = context.node.settings.admin_email
          else:
              # Else set default value
              context.output["signup_enabled"] = False
              context.output["admin_email"] = ""
  
          return context
  
      return set_defaults_from_settings
  
file_path: PySyft/packages/syft/src/syft/service/metadata/migrations.py
imports: from typing import Callable
  from ...types.syft_migration import migrate
  from ...types.transforms import TransformContext
  from ...types.transforms import drop
  from ...types.transforms import rename
  from .node_metadata import NodeMetadata
  from .node_metadata import NodeMetadataV2
  from .node_metadata import NodeMetadataV3
label_desc: Use image node_id 4 for calling a global function with example usage: _downgrade_metadata_v3_to_v2() and returns: set_defaults_from_settings, context