code: def __set_is_master_node():
      # noinspection PyBroadException
      try:
          # pop both set the first
          env_a = os.environ.pop("CLEARML_FORCE_MASTER_NODE", None)
          env_b = os.environ.pop("TRAINS_FORCE_MASTER_NODE", None)
          force_master_node = env_a or env_b
      except Exception:
          force_master_node = None
  
      if force_master_node is not None:
          # noinspection PyBroadException
          try:
              force_master_node = bool(int(force_master_node))
          except Exception:
              force_master_node = None
  
      return force_master_node
  
imports: import logging
  import os
  import sys
  from os.path import expandvars, expanduser
  from ..backend_api import load_config
  from ..backend_config import Config
  from ..backend_config.bucket_config import S3BucketConfigurations
  from .defs import *
  from .remote import running_remotely_task_id
  from ..utilities.proxy_object import LazyEvalWrapper
label_desc: Use image node_id 13 for calling a global function with example usage: __set_is_master_node() and returns: force_master_node