code: def stage_input(self):
          
  
          if self.workdir == self.outdir:
              return
          elif not os.path.isdir(self.workdir):
              self.logger.error('Working directory does not exist.')
              return
  
          self.logger.info('Staging files to %s', self.workdir)
  
          files = [os.path.join(self.outdir, f)
                   for f in os.listdir(self.outdir)]
  
          regex = copy.deepcopy(self.config['fileio']['workdir_regex'])
  
          for f in files:
  
              if not os.path.isfile(f):
                  continue
              if not utils.match_regex_list(regex, os.path.basename(f)):
                  continue
  
              self.logger.debug('Copying ' + os.path.basename(f))
              shutil.copy(f, self.workdir)
  
          for c in self.components:
              for f in c.files.values():
  
                  if f is None:
                      continue
  
                  wpath = os.path.join(self.workdir, os.path.basename(f))
                  opath = os.path.join(self.outdir, os.path.basename(f))
  
                  if os.path.isfile(wpath):
                      continue
                  elif os.path.isfile(opath):
                      self.logger.debug('Copying ' + os.path.basename(f))
                      shutil.copy(opath, self.workdir)
  
          self.logger.info('Finished.')
docs: Copy input files to working directory.