original_docstring: Make the output directory, if required.
  
      This is a little involved.  If the output directory already exists,
      we take the safe option by default, and stop with an error.  We can,
      however, choose to force the program to go on, in which case we can
      either clobber the existing directory, or not.  The options turn out
      as the following, if the directory exists:
  
      DEFAULT: stop and report the collision
      FORCE: continue, and remove the existing output directory
      NOCLOBBER+FORCE: continue, but do not remove the existing output
      
docstring: Make the output directory, if required.
  This is a little involved.  If the output directory already exists,
  we take the safe option by default, and stop with an error.  We can,
  however, choose to force the program to go on, in which case we can
  either clobber the existing directory, or not.  The options turn out
  as the following, if the directory exists.
  
  stop and report the collision
  FORCE: continue, and remove the existing output directory
  NOCLOBBER+FORCE: continue, but do not remove the existing output
docstring_tokens: Make the output directory if required . This is a little involved . If the output directory already exists we take the safe option by default and stop with an error . We can however choose to force the program to go on in which case we can either clobber the existing directory or not . The options turn out as the following if the directory exists . stop and report the collision FORCE : continue and remove the existing output directory NOCLOBBER + FORCE : continue but do not remove the existing output
code: def make_outdir():
      """Make the output directory, if required.
  
      This is a little involved.  If the output directory already exists,
      we take the safe option by default, and stop with an error.  We can,
      however, choose to force the program to go on, in which case we can
      either clobber the existing directory, or not.  The options turn out
      as the following, if the directory exists:
  
      DEFAULT: stop and report the collision
      FORCE: continue, and remove the existing output directory
      NOCLOBBER+FORCE: continue, but do not remove the existing output
      """
      if os.path.exists(args.outdirname):
          if not args.force:
              logger.error("Output directory %s would " % args.outdirname +
                           "overwrite existing files (exiting)")
              sys.exit(1)
          else:
              logger.info("Removing directory %s and everything below it" %
                          args.outdirname)
              if args.noclobber:
                  logger.warning("NOCLOBBER: not actually deleting directory")
              else:
                  shutil.rmtree(args.outdirname)
      logger.info("Creating directory %s" % args.outdirname)
      try:
          os.makedirs(args.outdirname)   # We make the directory recursively
      except OSError:
          # This gets thrown if the directory exists. If we've forced overwrite/
          # delete and we're not clobbering, we let things slide
          if args.noclobber and args.force:
              logger.info("NOCLOBBER+FORCE: not creating directory")
          else:
              logger.error(last_exception)
              sys.exit(1)
code_tokens: def make_outdir ( ) : if os . path . exists ( args . outdirname ) : if not args . force : logger . error ( "Output directory %s would " % args . outdirname + "overwrite existing files (exiting)" ) sys . exit ( 1 ) else : logger . info ( "Removing directory %s and everything below it" % args . outdirname ) if args . noclobber : logger . warning ( "NOCLOBBER: not actually deleting directory" ) else : shutil . rmtree ( args . outdirname ) logger . info ( "Creating directory %s" % args . outdirname ) try : os . makedirs ( args . outdirname ) except OSError : if args . noclobber and args . force : logger . info ( "NOCLOBBER+FORCE: not creating directory" ) else : logger . error ( last_exception ) sys . exit ( 1 )
short_docstring: Make the output directory, if required.
short_docstring_tokens: Make the output directory if required .
comment: """Make the output directory, if required.
  
      This is a little involved.  If the output directory already exists,
      we take the safe option by default, and stop with an error.  We can,
      however, choose to force the program to go on, in which case we can
      either clobber the existing directory, or not.  The options turn out
      as the following, if the directory exists:
  
      DEFAULT: stop and report the collision
      FORCE: continue, and remove the existing output directory
      NOCLOBBER+FORCE: continue, but do not remove the existing output
      """$SEP$# We make the directory recursively$SEP$# This gets thrown if the directory exists. If we've forced overwrite/$SEP$# delete and we're not clobbering, we let things slide