code: def init_cluster_context(
      computing_session_id: str, federation_session_id: str
  ):
      from fate.arch.federation import FederationBuilder, FederationMode
      from fate.arch.computing.backends.eggroll import CSession
  
      from fate.arch.context import Context
  
      args = HfArgumentParser(
          LauncherClusterContextArgs
      ).parse_args_into_dataclasses(return_remaining_strings=True)[0]
  
      cluster_host, cluster_port = args.cluster_address.split(":")
      computing_session = CSession(
          session_id=computing_session_id,
          host=cluster_host.strip(),
          port=int(cluster_port.strip()),
      )
  
      parties = get_parties(args.parties)
      party = parties[args.rank]
      federation_mode = FederationMode.from_str(args.federation_mode)
      federation_host, federation_port = args.federation_address.split(
          ":"
      )
      federation_session = FederationBuilder(
          federation_session_id=federation_session_id,
          party=party,
          parties=parties,
      ).build_osx(
          computing_session=computing_session,
          host=federation_host.strip(),
          port=int(federation_port.strip()),
          mode=federation_mode,
      )
  
      context = Context(
          computing=computing_session, federation=federation_session
      )
      return context
  
file_path: FATE/python/fate/arch/launchers/context_helper.py
imports: import os
  from dataclasses import dataclass, field
  from typing import List
  from .argparser import HfArgumentParser, get_parties
label_desc: Use image node_id 3 for calling a global function with example usage: init_cluster_context(computing_session_id, federation_session_id) and returns: context