code: def init_local_context(
      computing_session_id: str, federation_session_id: str
  ):
      from .paths import get_base_dir
      from fate.arch.computing.backends.standalone import CSession
      from fate.arch.federation import FederationBuilder
      from fate.arch.context import Context
  
      args = HfArgumentParser(
          LauncherLocalContextArgs
      ).parse_args_into_dataclasses(return_remaining_strings=True)[0]
  
      data_dir = args.data_dir
      if not data_dir:
          data_dir = os.path.join(get_base_dir(), "data")
      computing_session = CSession(
          session_id=computing_session_id, data_dir=data_dir
      )
  
      parties = get_parties(args.parties)
      party = parties[args.rank]
      federation_session = FederationBuilder(
          federation_session_id=federation_session_id,
          party=party,
          parties=parties,
      ).build_standalone(
          computing_session,
      )
      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 2 for calling a global function with example usage: init_local_context(computing_session_id, federation_session_id) and returns: context