code: def replaceLine(l, varDict, define):
      words = l.split()
      if words:
          if words[0] == cmakeDef:
              sPos = l.find(cmakeDef)
              ePos = sPos + len(cmakeDef)
              l = l[:sPos] + define + l[ePos:] + "\n"
          if words[0] == cmakeDef01:
              var = words[1]
              cmakeValue = varDict.get(var)
              if cmakeValue == "yes":
                  val = "1"
              else:
                  val = "0"
              sPos = l.find(cmakeDef01)
              ePos = l.find(var) + len(var)
              l = (
                  l[:sPos]
                  + define
                  + " "
                  + var
                  + " "
                  + val
                  + l[ePos + 1 :]
                  + "\n"
              )
  
      finder = re.compile(".*?(@[a-zA-Z0-9_]+@).*")
      while True:
          re_result = finder.match(l)
          if not re_result:
              return l
          key = re_result.group(1)[1:-1]
          l = (
              l[: re_result.start(1)]
              + varDict.get(key, "")
              + l[re_result.end(1) :]
          )
  
imports: import sys
  import os.path
  import re
label_desc: Use image node_id 1 for calling a global function with example usage: replaceLine(l, varDict, define) and returns: l