code: def _set_external_data(
      tensor: onnx.TensorProto,
      location: str,
      offset: int | None = None,
      length: int | None = None,
      checksum: str | None = None,
      basepath: str | None = None,
  ) -> None:
      del tensor.external_data[:]
      tensor.data_location = onnx.TensorProto.EXTERNAL
      for k, v in {
          "location": location,
          "offset": offset,
          "length": length,
          "checksum": checksum,
          "basepath": basepath,
      }.items():
          if v is not None:
              entry = tensor.external_data.add()
              entry.key = k
              entry.value = str(v)
  
imports: from __future__ import annotations
  import os
  import sys
  from typing import Any, Iterable
  import numpy
  import onnx
  import onnx.external_data_helper
  import onnx.helper
label_desc: Use image node_id 1 for calling a global function with example usage: _set_external_data(tensor, location, offset, length, checksum, basepath) without return types