code: def _try_to_detect_content_type(filename):
      mime_type, _ = mimetype_detector.guess_type(filename)
      if mime_type is not None:
          print(
              "Added {} as content-type of artifact {}.".format(
                  mime_type, filename
              )
          )
      else:
          print(
              "Failed to detect content-type automatically for "
              "artifact {}.".format(filename)
          )
      return mime_type
  
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 13 for calling the MongoObserver obj's underlying member method code with example usage: obj._try_to_detect_content_type(filename) and returns: mime_type