class_docstr: MongoObserver that uses a fault-tolerant background process.
class_docstr_tok: ["MongoObserver","that","uses","a","fault-tolerant","background","process","."]
docstr: Initializer for MongoObserver.
  
  Parameters
  ----------
  interval
      The interval in seconds at which the background thread is woken up to
      process new events.
  retry_interval
      The interval in seconds to wait if an event failed to be processed.
  url
      Mongo URI to connect to.
  db_name
      Database to connect to.
  collection
      Collection to write the runs to. (default: "runs").
  overwrite
      _id of a run that should be overwritten.
  priority
      (default 30)
  client
      Client to connect to. Do not use client and URL together.
  failure_dir
      Directory to save the run of a failed observer to.
docstr_tok: ["Initializer","for","MongoObserver",".","Parameters","--","--","--","--","--","interval","The","interval","in","seconds","at","which","the","background","thread","is","woken","up","to","process","new","events",".","retry_interval","The","interval","in","seconds","to","wait","if","an","event","failed","to","be","processed",".","url","Mongo","URI","to","connect","to",".","db_name","Database","to","connect","to",".","collection","Collection","to","write","the","runs","to",".","(","default",":","``","runs","''",")",".","overwrite","_id","of","a","run","that","should","be","overwritten",".","priority","(","default","30",")","client","Client","to","connect","to",".","Do","not","use","client","and","URL","together",".","failure_dir","Directory","to","save","the","run","of","a","failed","observer","to","."]
code: def __init__(
      self,
      interval: float = 20.0,
      retry_interval: float = 10.0,
      url: Optional[str] = None,
      db_name: str = "sacred",
      collection: str = "runs",
      overwrite: Optional[Union[int, str]] = None,
      priority: int = DEFAULT_MONGO_PRIORITY,
      client: Optional["pymongo.MongoClient"] = None,
      **kwargs,
  ):
      """Initializer for MongoObserver.
  
      Parameters
      ----------
      interval
          The interval in seconds at which the background thread is woken up to
          process new events.
      retry_interval
          The interval in seconds to wait if an event failed to be processed.
      url
          Mongo URI to connect to.
      db_name
          Database to connect to.
      collection
          Collection to write the runs to. (default: "runs").
      overwrite
          _id of a run that should be overwritten.
      priority
          (default 30)
      client
          Client to connect to. Do not use client and URL together.
      failure_dir
          Directory to save the run of a failed observer to.
      """
      super().__init__(
          QueueCompatibleMongoObserver(
              url=url,
              db_name=db_name,
              collection=collection,
              overwrite=overwrite,
              priority=priority,
              client=client,
              **kwargs,
          ),
          interval=interval,
          retry_interval=retry_interval,
      )
  
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 2 to create a new QueuedMongoObserver object from inherited base classes: QueueObserver with example: obj = QueuedMongoObserver(interval, retry_interval, url, db_name, collection, overwrite, priority, client)