code: def _expand_cmakedefines(line, cmake_vars):
      """Expands #cmakedefine declarations, using a dictionary 'cmake_vars'."""
  
      # Handles #cmakedefine lines
      match = _CMAKE_DEFINE_REGEX.match(line)
      if match:
          name = match.group(1)
          suffix = match.group(2) or ""
          if name in cmake_vars:
              return "#define {}{}\n".format(
                  name, _expand_variables(suffix, cmake_vars)
              )
          else:
              return "/* #undef {} */\n".format(name)
  
      # Handles #cmakedefine01 lines
      match = _CMAKE_DEFINE01_REGEX.match(line)
      if match:
          name = match.group(1)
          value = cmake_vars.get(name, "0")
          return "#define {} {}\n".format(name, value)
  
      # Otherwise return the line unchanged.
      return _expand_variables(line, cmake_vars)
  
imports: import re
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: _expand_cmakedefines(line, cmake_vars) and returns: _expand_variables, str, str, str