class_docstr: It is a MongoDB based manager that help you to manage data, network architecture, parameters and logging.
  
  Parameters
  -------------
  ip : str
      Localhost or IP address.
  port : int
      Port number.
  dbname : str
      Database name.
  username : str or None
      User name, set to None if you do not need authentication.
  password : str
      Password.
  project_name : str or None
      Experiment key for this entire project, similar with the repository name of Github.
  
  Attributes
  ------------
  ip, port, dbname and other input parameters : see above
      See above.
  project_name : str
      The given project name, if no given, set to the script name.
  db : mongodb client
      See ``pymongo.MongoClient``.
class_docstr_tok: ["It","is","a","MongoDB","based","manager","that","help","you","to","manage","data",",","network","architecture",",","parameters","and","logging",".","Parameters","--","--","--","--","--","--","-","ip",":","str","Localhost","or","IP","address",".","port",":","int","Port","number",".","dbname",":","str","Database","name",".","username",":","str","or","None","User","name",",","set","to","None","if","you","do","not","need","authentication",".","password",":","str","Password",".","project_name",":","str","or","None","Experiment","key","for","this","entire","project",",","similar","with","the","repository","name","of","Github",".","Attributes","--","--","--","--","--","--","ip",",","port",",","dbname","and","other","input","parameters",":","see","above","See","above",".","project_name",":","str","The","given","project","name",",","if","no","given",",","set","to","the","script","name",".","db",":","mongodb","client","See","``","pymongo.MongoClient","``","."]
docstr: Uploads a task to the database, timestamp will be added automatically.
  
  Parameters
  -----------
  task_name : str
      The task name.
  script : str
      File name of the python script.
  hyper_parameters : dictionary
      The hyper parameters pass into the script.
  saved_result_keys : list of str
      The keys of the task results to keep in the database when the task finishes.
  kwargs : other parameters
      Users customized parameters such as description, version number.
  
  Examples
  -----------
  Uploads a task
  >>> db.create_task(task_name='mnist', script='example/tutorial_mnist_simple.py', description='simple tutorial')
  
  Finds and runs the latest task
  >>> db.run_top_task(sort=[("time", pymongo.DESCENDING)])
  >>> db.run_top_task(sort=[("time", -1)])
  
  Finds and runs the oldest task
  >>> db.run_top_task(sort=[("time", pymongo.ASCENDING)])
  >>> db.run_top_task(sort=[("time", 1)])
docstr_tok: ["Uploads","a","task","to","the","database",",","timestamp","will","be","added","automatically",".","Parameters","--","--","--","--","--","-","task_name",":","str","The","task","name",".","script",":","str","File","name","of","the","python","script",".","hyper_parameters",":","dictionary","The","hyper","parameters","pass","into","the","script",".","saved_result_keys",":","list","of","str","The","keys","of","the","task","results","to","keep","in","the","database","when","the","task","finishes",".","kwargs",":","other","parameters","Users","customized","parameters","such","as","description",",","version","number",".","Examples","--","--","--","--","--","-","Uploads","a","task",">",">",">","db.create_task","(","task_name='mnist","'",",","script='example\/tutorial_mnist_simple.py","'",",","description='simple","tutorial","'",")","Finds","and","runs","the","latest","task",">",">",">","db.run_top_task","(","sort=","[","(","``","time","''",",","pymongo.DESCENDING",")","]",")",">",">",">","db.run_top_task","(","sort=","[","(","``","time","''",",","-1",")","]",")","Finds","and","runs","the","oldest","task",">",">",">","db.run_top_task","(","sort=","[","(","``","time","''",",","pymongo.ASCENDING",")","]",")",">",">",">","db.run_top_task","(","sort=","[","(","``","time","''",",","1",")","]",")"]
code: def create_task(
      self,
      task_name=None,
      script=None,
      hyper_parameters=None,
      saved_result_keys=None,
      **kwargs,
  ):
      """Uploads a task to the database, timestamp will be added automatically.
  
      Parameters
      -----------
      task_name : str
          The task name.
      script : str
          File name of the python script.
      hyper_parameters : dictionary
          The hyper parameters pass into the script.
      saved_result_keys : list of str
          The keys of the task results to keep in the database when the task finishes.
      kwargs : other parameters
          Users customized parameters such as description, version number.
  
      Examples
      -----------
      Uploads a task
      >>> db.create_task(task_name='mnist', script='example/tutorial_mnist_simple.py', description='simple tutorial')
  
      Finds and runs the latest task
      >>> db.run_top_task(sort=[("time", pymongo.DESCENDING)])
      >>> db.run_top_task(sort=[("time", -1)])
  
      Finds and runs the oldest task
      >>> db.run_top_task(sort=[("time", pymongo.ASCENDING)])
      >>> db.run_top_task(sort=[("time", 1)])
  
      """
      if not isinstance(task_name, str):  # is None:
          raise Exception("task_name should be string")
      if not isinstance(script, str):  # is None:
          raise Exception("script should be string")
      if hyper_parameters is None:
          hyper_parameters = {}
      if saved_result_keys is None:
          saved_result_keys = []
  
      self._fill_project_info(kwargs)
      kwargs.update({"time": datetime.utcnow()})
      kwargs.update({"hyper_parameters": hyper_parameters})
      kwargs.update({"saved_result_keys": saved_result_keys})
  
      _script = open(script, "rb").read()
  
      kwargs.update(
          {"status": "pending", "script": _script, "result": {}}
      )
      self.db.Task.insert_one(kwargs)
      logging.info(
          "[Database] Saved Task - task_name: {} script: {}".format(
              task_name, script
          )
      )
  
imports: import os
  import pickle
  import sys
  import time
  from datetime import datetime
  import numpy
  import tensorflow
  import gridfs
  import pymongo
  from tensorlayer import logging
  from tensorlayer.files import assign_weights, del_folder, exists_or_mkdir, load_hdf5_to_weights, save_weights_to_hdf5, static_graph2net
label_desc: Use image node_id 19 for calling the TensorHub obj's underlying member method code with example usage: obj.create_task(task_name, script, hyper_parameters, saved_result_keys) without return types