code: def artifact_event(
      self, name, filename, metadata=None, content_type=None
  ):
      with open(filename, "rb") as f:
          run_id = self.run_entry["_id"]
          db_filename = "artifact://{}/{}/{}".format(
              self.runs.name, run_id, name
          )
          if content_type is None:
              content_type = self._try_to_detect_content_type(filename)
  
          file_id = self.fs.put(
              f,
              filename=db_filename,
              metadata=metadata,
              content_type=content_type,
          )
  
      self.run_entry["artifacts"].append(
          {"name": name, "file_id": file_id}
      )
      self.save()
  
imports: from typing import Optional, Union
  import mimetypes
  import os.path
  import pickle
  import re
  import sys
  import time
  from tempfile import NamedTemporaryFile
  import warnings
  import sacred.optional
  from sacred.commandline_options import cli_option
  from sacred.dependencies import get_digest
  from sacred.observers.base import RunObserver
  from sacred.observers.queue import QueueObserver
  from sacred.serializer import flatten
  from sacred.utils import ObserverError, PathType
  import pkg_resources
label_desc: Use image node_id 12 for calling the MongoObserver obj's underlying member method code with example usage: obj.artifact_event(name, filename, metadata, content_type) without return types