def generate_submit_scripts(templates, prefix=None, deffnm='<STR_LIT>', jobname='<STR_LIT>', budget=None,<EOL>mdrun_opts=None, walltime=<NUM_LIT:1.0>, jobarray_string=None, startdir=None,<EOL>npme=None, **kwargs):
if not jobname[<NUM_LIT:0>].isalpha():<EOL><INDENT>jobname = '<STR_LIT>'+jobname<EOL>wmsg = "<STR_LIT>".format(jobname)<EOL>logger.warn(wmsg)<EOL>warnings.warn(wmsg, category=AutoCorrectionWarning)<EOL><DEDENT>if prefix is None:<EOL><INDENT>prefix = "<STR_LIT>"<EOL><DEDENT>if mdrun_opts is not None:<EOL><INDENT>mdrun_opts = '<STR_LIT:">'+str(mdrun_opts)+'<STR_LIT:">'  <EOL><DEDENT>dirname = kwargs.pop('<STR_LIT>', os.path.curdir)<EOL>wt = Timedelta(hours=walltime)<EOL>walltime = wt.strftime("<STR_LIT>")<EOL>wall_hours = wt.ashours<EOL>def write_script(template):<EOL><INDENT>submitscript = os.path.join(dirname, prefix + os.path.basename(template))<EOL>logger.info("<STR_LIT>".format(**vars()))<EOL>qsystem = detect_queuing_system(template)<EOL>if qsystem is not None and (qsystem.name == '<STR_LIT>'):<EOL><INDENT>cbook.edit_txt(template,<EOL>[('<STR_LIT>','<STR_LIT>', deffnm),<EOL>('<STR_LIT>', '<STR_LIT>', jobname),<EOL>('<STR_LIT>', '<STR_LIT>', budget),<EOL>('<STR_LIT>', '<STR_LIT>', walltime),<EOL>('<STR_LIT>', '<STR_LIT>', wall_hours),<EOL>('<STR_LIT>', '<STR_LIT>', startdir),<EOL>('<STR_LIT>', '<STR_LIT>', npme),<EOL>('<STR_LIT>', '<STR_LIT>', mdrun_opts),  <EOL>('<STR_LIT>', '<STR_LIT>', jobarray_string),<EOL>],<EOL>newname=submitscript)<EOL>ext = os.path.splitext(submitscript)[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>cbook.edit_txt(template,<EOL>[('<STR_LIT>','<STR_LIT>', deffnm),<EOL>('<STR_LIT>', '<STR_LIT>', jobname),<EOL>('<STR_LIT>', '<STR_LIT>', budget),<EOL>('<STR_LIT>', '<STR_LIT>', walltime),<EOL>('<STR_LIT>', '<STR_LIT>', wall_hours),<EOL>('<STR_LIT>', '<STR_LIT>', startdir),<EOL>('<STR_LIT>', '<STR_LIT>', npme),<EOL>('<STR_LIT>', '<STR_LIT>', mdrun_opts),  <EOL>('<STR_LIT>', '<STR_LIT>', jobarray_string),<EOL>],<EOL>newname=submitscript)<EOL>ext = os.path.splitext(submitscript)[<NUM_LIT:1>]<EOL><DEDENT>if ext in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>os.chmod(submitscript, <NUM_LIT>)<EOL><DEDENT>return submitscript<EOL><DEDENT>return [write_script(template) for template in config.get_templates(templates)]<EOL>
Write scripts for queuing systems.


    This sets up queuing system run scripts with a simple search and replace in
    templates. See :func:`gromacs.cbook.edit_txt` for details. Shell scripts
    are made executable.

    :Arguments:
      *templates*
          Template file or list of template files. The "files" can also be names
          or symbolic names for templates in the templates directory. See
          :mod:`gromacs.config` for details and rules for writing templates.
      *prefix*
          Prefix for the final run script filename; by default the filename will be
          the same as the template. [None]
      *dirname*
          Directory in which to place the submit scripts. [.]
      *deffnm*
          Default filename prefix for :program:`mdrun` ``-deffnm`` [md]
      *jobname*
          Name of the job in the queuing system. [MD]
      *budget*
          Which budget to book the runtime on [None]
      *startdir*
          Explicit path on the remote system (for run scripts that need to `cd`
          into this directory at the beginning of execution) [None]
      *mdrun_opts*
          String of additional options for :program:`mdrun`.
      *walltime*
          Maximum runtime of the job in hours. [1]
      *npme*
          number of PME nodes
      *jobarray_string*
          Multi-line string that is spliced in for job array functionality
          (see :func:`gromacs.qsub.generate_submit_array`; do not use manually)
      *kwargs*
          all other kwargs are ignored

    :Returns: list of generated run scripts