code: def need_to_translate(source, target):
      if not target.exists():
          failed_files.append("(missing) " + target.as_posix())
          if pipeline_mode:
              return
          shutil.copyfile(source, target)
      if target.suffix == ".html":
          return  # FIXME I don't know how to process html
      target_checksum = hashlib.sha256(
          path.open("rb").read()
      ).hexdigest()[:32]
      checksum = target.open("r").readline().strip()[3:]
      if checksum != target_checksum:
          failed_files.append("(out-of-date) " + target.as_posix())
          if pipeline_mode:
              return
      contents = target.open("r").readlines()
      firstline = ".. " + target_checksum + "\n"
      if contents[0].startswith(".. "):
          contents = [firstline] + contents[1:]
      else:
          contents = [firstline, "\n"] + contents
      target.open("w").writelines(contents)
  
imports: import hashlib
  import shutil
  import sys
  from pathlib import Path
label_desc: Use image node_id 2 for calling a global function with example usage: need_to_translate(source, target) without return types