parameters: (args)
return_statement: return parser.parse_args(args)
docstring: Takes in the command-line arguments list (args), and returns a nice argparse
      result with fields for all the options.
      
      Borrows heavily from the argparse documentation examples:
      <http://docs.python.org/library/argparse.html>
docstring_summary: Takes in the command-line arguments list (args), and returns a nice argparse
      result with fields for all the options.
      
      Borrows heavily from the argparse documentation examples:
      <http://docs.python.org/library/argparse.html>
docstring_tokens: Takes in the command - line arguments list ( args ) and returns a nice argparse result with fields for all the options . Borrows heavily from the argparse documentation examples : <http : // docs . python . org / library / argparse . html >
function: def parse_args(args):
      """
      Takes in the command-line arguments list (args), and returns a nice argparse
      result with fields for all the options.
      
      Borrows heavily from the argparse documentation examples:
      <http://docs.python.org/library/argparse.html>
      """
      
      # Construct the parser (which is stored in parser)
      # Module docstring lives in __doc__
      # See http://python-forum.com/pythonforum/viewtopic.php?f=3&t=36847
      # And a formatter class so our examples in the docstring look good. Isn't it
      # convenient how we already wrapped it to 80 characters?
      # See http://docs.python.org/library/argparse.html#formatter-class
      parser = argparse.ArgumentParser(description=__doc__, 
          formatter_class=argparse.RawDescriptionHelpFormatter)
      
      parser.add_argument("--input", type=argparse.FileType('r'), default=sys.stdin,
                          help="JSON GAM to process")
      parser.add_argument("--positions", required=True, type=argparse.FileType('w'),
                          help="TSV of positions and counts to write")
      parser.add_argument("--lengths", required=True, type=argparse.FileType('w'),
                          help="TSV of lengths and counts to write")
      parser.add_argument("--mapqs", required=True, type=argparse.FileType('w'),
                          help="TSV of indel/gapless categories, MAPQs and counts to write")
      
      # The command line arguments start with the program name, which we don't
      # want to treat as an argument for argparse. So we remove it.
      args = args[1:]
          
      return parser.parse_args(args)
function_tokens: def parse_args ( args ) : # Construct the parser (which is stored in parser) # Module docstring lives in __doc__ # See http://python-forum.com/pythonforum/viewtopic.php?f=3&t=36847 # And a formatter class so our examples in the docstring look good. Isn't it # convenient how we already wrapped it to 80 characters? # See http://docs.python.org/library/argparse.html#formatter-class parser = argparse . ArgumentParser ( description = __doc__ , formatter_class = argparse . RawDescriptionHelpFormatter ) parser . add_argument ( "--input" , type = argparse . FileType ( 'r' ) , default = sys . stdin , help = "JSON GAM to process" ) parser . add_argument ( "--positions" , required = True , type = argparse . FileType ( 'w' ) , help = "TSV of positions and counts to write" ) parser . add_argument ( "--lengths" , required = True , type = argparse . FileType ( 'w' ) , help = "TSV of lengths and counts to write" ) parser . add_argument ( "--mapqs" , required = True , type = argparse . FileType ( 'w' ) , help = "TSV of indel/gapless categories, MAPQs and counts to write" ) # The command line arguments start with the program name, which we don't # want to treat as an argument for argparse. So we remove it. args = args [ 1 : ] return parser . parse_args ( args )