code: def load_external_data_for_model(
      model: ModelProto, base_dir: str
  ) -> None:
      """Loads external tensors into model
  
      Arguments:
          model: ModelProto to load external data to
          base_dir: directory that contains external data
      """
      for tensor in _get_all_tensors(model):
          if uses_external_data(tensor):
              load_external_data_for_tensor(tensor, base_dir)
              # After loading raw_data from external_data, change the state of tensors
              tensor.data_location = TensorProto.DEFAULT
              # and remove external data
              del tensor.external_data[:]
  
imports: import os
  import re
  import sys
  import uuid
  from itertools import chain
  from typing import Callable, Iterable, Optional
  from onnx.onnx_pb import AttributeProto, GraphProto, ModelProto, TensorProto
label_desc: Use image node_id 2 for calling a global function with example usage: load_external_data_for_model(model, base_dir) without return types