code: def read_from_config(key, default_value, flink_conf_file):
      value = default_value
      # get the realpath of tainted path value to avoid CWE22 problem that constructs a path or URI
      # using the tainted value and might allow an attacker to access, modify, or test the existence
      # of critical or sensitive files.
      with open(os.path.realpath(flink_conf_file), "r") as f:
          while True:
              line = f.readline()
              if not line:
                  break
              if line.startswith("#") or len(line.strip()) == 0:
                  continue
              k, v = line.split(":", 1)
              if k.strip() == key:
                  value = v.strip()
      return value
  
imports: import argparse
  import getpass
  import glob
  import os
  import platform
  import signal
  import socket
  import sys
  from collections import namedtuple
  from string import Template
  from subprocess import Popen, PIPE
  from pyflink.find_flink_home import _find_flink_home, _find_flink_source_root
label_desc: Use image node_id 2 for calling a global function with example usage: read_from_config(key, default_value, flink_conf_file) and returns: value