code: def init_role():
      # reset the place according to role of parameter server
      training_role = os.getenv("TRAINING_ROLE", "TRAINER")
      paddle_role = role_maker.Role.WORKER
      place = F.CPUPlace()
      if training_role == "PSERVER":
          paddle_role = role_maker.Role.SERVER
  
      # set the fleet runtime environment according to configure
      ports = os.getenv("PADDLE_PORT", "6174").split(",")
      pserver_ips = os.getenv("PADDLE_PSERVERS").split(",")  # ip,ip...
      eplist = []
      if len(ports) > 1:
          # local debug mode, multi port
          for port in ports:
              eplist.append(":".join([pserver_ips[0], port]))
      else:
          # distributed mode, multi ip
          for ip in pserver_ips:
              eplist.append(":".join([ip, ports[0]]))
  
      pserver_endpoints = eplist  # ip:port,ip:port...
      worker_num = int(os.getenv("PADDLE_TRAINERS_NUM", "0"))
      trainer_id = int(os.getenv("PADDLE_TRAINER_ID", "0"))
      role = role_maker.UserDefinedRoleMaker(
          current_id=trainer_id,
          role=paddle_role,
          worker_num=worker_num,
          server_endpoints=pserver_endpoints,
      )
      fleet.init(role)
  
file_path: PGL/legacy/examples/distribute_graphsage/cluster_train.py
imports: import argparse
  import time
  import os
  import math
  import numpy
  import paddle.fluid
  import paddle.fluid.layers
  from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
  from paddle.fluid.transpiler.distribute_transpiler import DistributeTranspilerConfig
  import paddle.fluid.incubate.fleet.base.role_maker
  from pgl.utils.logger import log
  from model import GraphsageModel
  from utils import load_config
  import reader
label_desc: Use image node_id 1 for calling a global function with example usage: init_role() without return types