docs: def run(self, command, name_addition=None, cmd_kwargs=None,
              _cmd="sbatch", tries=1, depends_on=None):
          """
          command: a bash command that you want to run
          name_addition: if not specified, the sha1 of the command to run
                         appended to job name. if it is "date", the yyyy-mm-dd
                         date will be added to the job name.
          cmd_kwargs: dict of extra arguments to fill in command
                     (so command itself can be a template).
          _cmd: submit command (change to "bash" for testing).
          tries: try to run a job either this many times or until the first
                 success.
          depends_on: job ids that this depends on before it is run (users 'afterok')
          """
          if name_addition is None:
              name_addition = hashlib.sha1(command.encode("utf-8")).hexdigest()
  
          if self.date_in_name:
              name_addition += "-" + str(datetime.date.today())
          name_addition = name_addition.strip(" -")
  
          if cmd_kwargs is None:
              cmd_kwargs = {}
  
          n = self.name
          self.name = self.name.strip(" -")
          self.name += ("-" + name_addition.strip(" -"))
          args = []
          for k, v in cmd_kwargs.items():
              args.append("export %s=%s" % (k, v))
          args = "\n".join(args)
  
          tmpl = str(self).replace("__script__", args + "\n###\n" + command)
          if depends_on is None or (len(depends_on) == 1 and depends_on[0] is None):
              depends_on = []
  
          with open(self._tmpfile(), "w") as sh:
              sh.write(tmpl)
  
          job_id = None
          for itry in range(1, tries + 1):
              args = [_cmd]
              args.extend([("--dependency=afterok:%d" % int(d))
                           for d in depends_on])
              if itry > 1:
                  mid = "--dependency=afternotok:%d" % job_id
                  args.append(mid)
              args.append(sh.name)
              res = subprocess.check_output(args).strip()
              print(res, file=sys.stderr)
              self.name = n
              if not res.startswith(b"Submitted batch"):
                  return None
              j_id = int(res.split()[-1])
              if itry == 1:
                  job_id = j_id
          return job_id