parameters: (args: argparse.Namespace)
return_statement: return output_dir
docstring: Get the output directory.
docstring_summary: Get the output directory.
docstring_tokens: Get the output directory .
function: def create_output_dir(args: argparse.Namespace) -> str:
    """Get the output directory."""
    output_dir = abs_expand_all(args.outdir)
    if not os.path.isdir(output_dir):
      try:
        os.makedirs(output_dir)
      except OSError as e:
        print(e, file=sys.stderr)
        sys.exit(-1)
  
    if (not (os.path.isdir(output_dir) and os.access(output_dir, os.X_OK) and
             os.access(output_dir, os.W_OK))):
      print(
          "Output folder ({output_dir}) is not accessible. Check permissions."
          .format(output_dir=output_dir),
          file=sys.stderr)
      sys.exit(-1)
  
    return output_dir
function_tokens: def create_output_dir ( args : argparse . Namespace ) -> str : output_dir = abs_expand_all ( args . outdir ) if not os . path . isdir ( output_dir ) : try : os . makedirs ( output_dir ) except OSError as e : print ( e , file = sys . stderr ) sys . exit ( - 1 ) if ( not ( os . path . isdir ( output_dir ) and os . access ( output_dir , os . X_OK ) and os . access ( output_dir , os . W_OK ) ) ) : print ( "Output folder ({output_dir}) is not accessible. Check permissions." . format ( output_dir = output_dir ) , file = sys . stderr ) sys . exit ( - 1 ) return output_dir