class_docstr: Manages a Mongo-DB for storing metrics and delivering parameters to trials.
  
  The Mongo-DB contains one database that serves as a queue of future trials
  and one to store results of active and finished trials.
  
  Attributes:
      dbpath (str): the path where Mongo-DB stores its files.
      port (int): the port on which the Mongo-DB should run.
      reinstantiated (bool): whether an instance of the MongoDB is being loaded.
      mongodb_args (dict): keyword arguments to MongoDB
class_docstr_tok: ["Manages","a","Mongo-DB","for","storing","metrics","and","delivering","parameters","to","trials",".","The","Mongo-DB","contains","one","database","that","serves","as","a","queue","of","future","trials","and","one","to","store","results","of","active","and","finished","trials",".","Attributes",":","dbpath","(","str",")",":","the","path","where","Mongo-DB","stores","its","files",".","port","(","int",")",":","the","port","on","which","the","Mongo-DB","should","run",".","reinstantiated","(","bool",")",":","whether","an","instance","of","the","MongoDB","is","being","loaded",".","mongodb_args","(","dict",")",":","keyword","arguments","to","MongoDB"]
docstr: Adds a trial for stopping.
  
  In the trial-script this will raise an exception causing the trial to
  stop.
  
  Args:
      trial_id (int): the ID of the trial to stop.
docstr_tok: ["Adds","a","trial","for","stopping",".","In","the","trial-script","this","will","raise","an","exception","causing","the","trial","to","stop",".","Args",":","trial_id","(","int",")",":","the","ID","of","the","trial","to","stop","."]
code: def add_for_stopping(self, trial_id):
      """
      Adds a trial for stopping.
  
      In the trial-script this will raise an exception causing the trial to
      stop.
  
      Args:
          trial_id (int): the ID of the trial to stop.
      """
      self.check_db_status()
      dblogger.debug("Adding {} to DB".format({"trial_id": trial_id}))
      self.db.stop.insert_one({"trial_id": trial_id}).inserted_id
  
imports: import logging
  import numpy
  import pymongo
  from pymongo import MongoClient
  import subprocess
  import time
  import os
  import socket
  import warnings
  import sherpa
label_desc: Use image node_id 7 for calling the _Database obj's underlying member method code with example usage: obj.add_for_stopping(trial_id) without return types