code: def _opti_file_loader(ctx, fileloaders, nnp, filename, ext):
      """.optimizer
      optimizer file loader
      This loader only handles .optimizer file.
      """
      file_type = get_buf_type(filename)
      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:
              o = ctx.optimizers.get(p_opti.name, None)
              if o:
                  o.solver.set_states_from_protobuf(p_opti)
              else:
                  logger.warning(
                      "No matched optimizer is found for {}.".format(
                          filename
                      )
                  )
      elif file_type == "h5":
          loaded = False
          for o in ctx.optimizers.values():
              key = "{}_{}_optimizer.h5.optimizer".format(
                  o.name, re.sub(r"(|Cuda)$", "", str(o.solver.name))
              )
              if key == filename:
                  o.solver.set_states(
                      load_solve_state_from_h5(nnp, filename)
                  )
                  loaded = True
          if not loaded:
              logger.warning(
                  "No matched optimizer is found for {}.".format(
                      filename
                  )
              )
  
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 8 for calling a global function with example usage: _opti_file_loader(ctx, fileloaders, nnp, filename, ext) without return types