class_docstr: Experiment Class - create and run an experiment
  
  :param exp_config: configuration of the experiment
  :type exp_config: BasicConfig.BasicConfig
  :param username: username, default: None - will use login username
  :type username: str
  :param connector: connector to database
  :type connector: AbstractConnector
  :param auppath: Auptimizer env.ini file folder, default is either ``./.aup`` or ``~/.aup``
  :type auppath: str
  :param sleep_time: time to pause between jobs
  :type sleep_time: int
class_docstr_tok: ["Experiment","Class","-","create","and","run","an","experiment",":","param","exp_config",":","configuration","of","the","experiment",":","type","exp_config",":","BasicConfig.BasicConfig",":","param","username",":","username",",","default",":","None","-","will","use","login","username",":","type","username",":","str",":","param","connector",":","connector","to","database",":","type","connector",":","AbstractConnector",":","param","auppath",":","Auptimizer","env.ini","file","folder",",","default","is","either","``",".\/.aup","``","or","``","~\/.aup","``",":","type","auppath",":","str",":","param","sleep_time",":","time","to","pause","between","jobs",":","type","sleep_time",":","int"]
docstr: Submit a new job to run if there is resource available
  :param job: optional job parameter in case a job needs resubmitting
  :type job: aup.EE.Job.Job object
  :param rid_blacklist: resource ids to exclude when submitting job
  :type rid_blacklist: [int]
  
  :return: True if job submitted, else False
docstr_tok: ["Submit","a","new","job","to","run","if","there","is","resource","available",":","param","job",":","optional","job","parameter","in","case","a","job","needs","resubmitting",":","type","job",":","aup.EE.Job.Job","object",":","param","rid_blacklist",":","resource","ids","to","exclude","when","submitting","job",":","type","rid_blacklist",":","[","int","]",":","return",":","True","if","job","submitted",",","else","False"]
code: def submit_job(self, job=None, rid_blacklist=None):
      """
      Submit a new job to run if there is resource available
      :param job: optional job parameter in case a job needs resubmitting
      :type job: aup.EE.Job.Job object
      :param rid_blacklist: resource ids to exclude when submitting job
      :type rid_blacklist: [int]
  
      :return: True if job submitted, else False
      """
      rid = self.resource_manager.get_available(
          self.username,
          self.exp_config["resource"],
          rid_blacklist=rid_blacklist,
      )
      if rid is None:
          self.resource_manager.log_error_message(
              "Not enough resources!"
          )
          logger.warning(
              "Increase resource or reduce n_parallel, no enough resources"
          )
          return False
  
      if job is None:
          proposal = self.proposer.get()
          if proposal is not None and self.is_compression_exp:
              proposal = deserialize_compression_proposal(
                  self.exp_config, self.compression_params, proposal
              )
          self.proposer.increment_job_counter()
      if job is None and proposal is None:
          if self.exp_config["proposer"] in SPECIAL_EXIT_PROPOSERS:
              logger.info(
                  "%s is waiting to finish."
                  % self.exp_config["proposer"]
              )
              return True
          else:
              logger.warning(
                  "Waiting other jobs finished\n"
                  "Think about rebalance your task loads, if you see this message shows up too many"
              )
              return False
      else:
          if job is None:
              job_config = BasicConfig(**proposal)
              job = Job(
                  self.exp_config["script"],
                  job_config,
                  self.exp_config["workingdir"],
                  retries=self.job_retries,
              )
              job.jid = self.resource_manager.connector.job_started(
                  self.eid, rid, job_config
              )
          else:
              self.resource_manager.connector.job_retry(rid, job.jid)
          logger.info(
              "Submitting job %d with resource %d in experiment %d"
              % (job.jid, rid, self.eid)
          )
          job.was_executed = False
          self.pending_jobs[job.jid] = job
          # update the status, but after appending to pending_jobs
          # to avoid premature termination
          self.proposer.check_termination()
          self.resource_manager.run_job(
              job,
              rid,
              self.exp_config,
              self.update,
              **self.runtime_args,
          )
          return True
  
imports: import json
  import logging
  import os
  import signal
  import sys
  import _thread
  import threading
  import time
  from ..Proposer import get_proposer, SPECIAL_EXIT_PROPOSERS
  from .Job import Job
  from .Resource import get_resource_manager
  from ..aup import BasicConfig
  from ..utils import set_default_keyvalue, check_missing_key, get_default_connector, get_default_username
  from ..compression.utils import *
  from ..Proposer import ProposerStatus
label_desc: Use image node_id 7 for calling the Experiment obj's underlying member method code with example usage: obj.submit_job(job, rid_blacklist) and returns: False, True, True, False