code: def _opti_file_rough_loader(ctx, fileloaders, nnp, filename, ext):
      """.optimizer
      optimizer solver checkpoint file rough loader
      This loader loads solver state and allow user to decide when to restore it
      """
      file_type = get_buf_type(filename)
      optimizer_states = OrderedDict()
      if file_type == "protobuf":
          opti_proto = nnabla_pb2.NNablaProtoBuf()
          with get_file_handle_load(nnp, filename, ".protobuf") as f:
              opti_proto.MergeFromString(f.read())
          for p_opti in opti_proto.optimizer:
              optimizer_states[p_opti.name] = (".protobuf", p_opti)
      elif file_type == "h5":
          h5fio = io.BytesIO()
          h5fio.name = f"{'_'.join(filename.split('_')[:2])}.h5"
          with nnp.open(filename, "r") as f:
              h5fio.write(f.read())
              h5fio.seek(0)
          optimizer_states[filename.split("_")[0]] = (".h5", h5fio)
      ctx.optimizer_states_checkpoint = optimizer_states
  
imports: import contextlib
  import io
  import os
  import re
  import zipfile
  from collections import OrderedDict
  from functools import partial
  import google.protobuf.text_format
  import h5py
  import nnabla
  import numpy
  from nnabla.logger import logger
  from nnabla.utils import nnabla_pb2
  from nnabla.utils.nnp_format import nnp_version
label_desc: Use image node_id 9 for calling a global function with example usage: _opti_file_rough_loader(ctx, fileloaders, nnp, filename, ext) without return types