code: def format_script(s: str) -> str:
      """
      Remove leading and trailing blank lines, and make the minimum idention 0
      """
      s = s.strip("\n")
  
      non_empty_lines = [
          line for line in s.splitlines() if line and not line.isspace()
      ]
      if not non_empty_lines:
          # no actual content
          return "\n"
  
      line_indents = [
          len(line) - len(line.lstrip(" ")) for line in non_empty_lines
      ]
      spaces_to_remove = min(line_indents)
  
      cleaned_lines = "\n".join(
          line[spaces_to_remove:] for line in s.splitlines()
      )
      if not cleaned_lines.endswith("\n"):
          cleaned_lines += "\n"
      return cleaned_lines.strip()
  
imports: from typing import Optional
  import pytest
  from tvm.runtime import ObjectPath
  from tvm.script.printer.doc import ExprStmtDoc, IdDoc, OperationDoc, OperationKind, StmtBlockDoc
  from tvm.script.printer.doc_printer import to_python_script
  from tvm.script import ir, tir
label_desc: Use image node_id 3 for calling a global function with example usage: format_script(s) and returns: cleaned_lines, str