code: def inject_telemetry_to_static(static_folder):
      TEXT = "<script>localStorage.isTestUser = true;</script>"
      index = Path(static_folder).joinpath("index.html")
      disable_telemetry = os.getenv(
          "CHECK_FOR_UPDATES", "1"
      ).lower() in ["0", "false", "False"]
      if index.is_file():
          with open(str(index), "rt") as f:
              content = f.read()
          script_index = content.find("<script>")
          need_update = True
          if TEXT not in content and disable_telemetry:
              content = (
                  content[:script_index] + TEXT + content[script_index:]
              )
          elif not disable_telemetry and TEXT in content:
              content = content.replace(TEXT, "")
          else:
              need_update = False
  
          if need_update:
              with open(str(index), "wt") as f:
                  f.write(content)
  
imports: import os
  from pathlib import Path
label_desc: Use image node_id 4 for calling a global function with example usage: inject_telemetry_to_static(static_folder) without return types