code: def set_meta_data(self, metadata):
      # Create a dict mapping model_name to number
      models = {}
      for name, number in METADATA_MODELS.__dict__.items():
          if name.startswith("FIMD_"):
              models[name[5:]] = number
  
      # Create a mapping from numpy.dtype to METADATA_DATATYPE
      def get_tag_type_number(dtype):
          for number, numpy_dtype in METADATA_DATATYPE.dtypes.items():
              if dtype == numpy_dtype:
                  return number
          else:
              return None
  
      with self._fi as lib:
          for model_name, subdict in metadata.items():
              # Get model number
              number = models.get(model_name, None)
              if number is None:
                  continue  # Unknown model, silent ignore
  
              for tag_name, tag_val in subdict.items():
                  # Create new tag
                  tag = lib.FreeImage_CreateTag()
                  tag = ctypes.c_void_p(tag)
  
                  try:
                      # Convert Python value to FI type, val
                      is_ascii = False
                      if isinstance(tag_val, str):
                          try:
                              tag_bytes = tag_val.encode("ascii")
                              is_ascii = True
                          except UnicodeError:
                              pass
                      if is_ascii:
                          tag_type = METADATA_DATATYPE.FIDT_ASCII
                          tag_count = len(tag_bytes)
                      else:
                          if not hasattr(tag_val, "dtype"):
                              tag_val = numpy.array([tag_val])
                          tag_type = get_tag_type_number(tag_val.dtype)
                          if tag_type is None:
                              logger.warning(
                                  "imageio.freeimage warning: Could not "
                                  "determine tag type of %r." % tag_name
                              )
                              continue
                          tag_bytes = tag_val.tobytes()
                          tag_count = tag_val.size
                      # Set properties
                      lib.FreeImage_SetTagKey(
                          tag, tag_name.encode("utf-8")
                      )
                      lib.FreeImage_SetTagType(tag, tag_type)
                      lib.FreeImage_SetTagCount(tag, tag_count)
                      lib.FreeImage_SetTagLength(tag, len(tag_bytes))
                      lib.FreeImage_SetTagValue(tag, tag_bytes)
                      # Store tag
                      tag_key = lib.FreeImage_GetTagKey(tag)
                      lib.FreeImage_SetMetadata(
                          number, self._bitmap, tag_key, tag
                      )
  
                  except Exception as err:  # pragma: no cover
                      logger.warning(
                          "imagio.freeimage warning: Could not set tag "
                          "%r: %s, %s"
                          % (
                              tag_name,
                              self._fi._get_error_message(),
                              str(err),
                          )
                      )
                  finally:
                      lib.FreeImage_DeleteTag(tag)
  
imports: import os
  import sys
  import ctypes
  import threading
  import logging
  import numpy
  from ..core import get_remote_file, load_lib, Dict, resource_dirs, IS_PYPY, get_platform, InternetNotAllowedError, NeedDownloadError
label_desc: Use image node_id 6 for calling the FIBaseBitmap obj's underlying member method code with example usage: obj.set_meta_data(metadata) and returns: None, number