class_docstr: Represent and manage a single run of an experiment.
class_docstr_tok: ["Represent","and","manage","a","single","run","of","an","experiment","."]
docstr: Add a file as an artifact.
  
  In Sacred terminology an artifact is a file produced by the experiment
  run. In case of a MongoObserver that means storing the file in the
  database.
  
  See also :py:meth:`sacred.Experiment.add_artifact`.
  
  Parameters
  ----------
  filename : str
      name of the file to be stored as artifact
  name : str, optional
      optionally set the name of the artifact.
      Defaults to the filename.
  metadata: dict
      optionally attach metadata to the artifact.
      This only has an effect when using the MongoObserver.
  content_type: str, optional
      optionally attach a content-type to the artifact.
      This only has an effect when using the MongoObserver.
docstr_tok: ["Add","a","file","as","an","artifact",".","In","Sacred","terminology","an","artifact","is","a","file","produced","by","the","experiment","run",".","In","case","of","a","MongoObserver","that","means","storing","the","file","in","the","database",".","See","also",":","py",":","meth",":","`","sacred.Experiment.add_artifact","`",".","Parameters","--","--","--","--","--","filename",":","str","name","of","the","file","to","be","stored","as","artifact","name",":","str",",","optional","optionally","set","the","name","of","the","artifact",".","Defaults","to","the","filename",".","metadata",":","dict","optionally","attach","metadata","to","the","artifact",".","This","only","has","an","effect","when","using","the","MongoObserver",".","content_type",":","str",",","optional","optionally","attach","a","content-type","to","the","artifact",".","This","only","has","an","effect","when","using","the","MongoObserver","."]
code: def add_artifact(
      self, filename, name=None, metadata=None, content_type=None
  ):
      """Add a file as an artifact.
  
      In Sacred terminology an artifact is a file produced by the experiment
      run. In case of a MongoObserver that means storing the file in the
      database.
  
      See also :py:meth:`sacred.Experiment.add_artifact`.
  
      Parameters
      ----------
      filename : str
          name of the file to be stored as artifact
      name : str, optional
          optionally set the name of the artifact.
          Defaults to the filename.
      metadata: dict
          optionally attach metadata to the artifact.
          This only has an effect when using the MongoObserver.
      content_type: str, optional
          optionally attach a content-type to the artifact.
          This only has an effect when using the MongoObserver.
      """
      filename = os.path.abspath(filename)
      name = os.path.basename(filename) if name is None else name
      self._emit_artifact_added(name, filename, metadata, content_type)
  
imports: import datetime
  import os.path
  import sys
  import traceback
  from sacred import metrics_logger, SETTINGS
  from sacred.metrics_logger import linearize_metrics
  from sacred.randomness import set_global_seed
  from sacred.utils import SacredInterrupt, join_paths, IntervalTimer
  from sacred.stdout_capturing import get_stdcapturer
label_desc: Use image node_id 4 for calling the Run obj's underlying member method code with example usage: obj.add_artifact(filename, name, metadata, content_type) without return types