Create EBNF files and EBNF-based parsers
497822
def create_ebnf_parser(files):
    """"""

    flag = False
    for belspec_fn in files:
        # Get EBNF Jinja template from Github if enabled
        if config["bel"]["lang"]["specification_github_repo"]:
            tmpl_fn = get_ebnf_template()

        # Check if EBNF file is more recent than belspec_fn
        ebnf_fn = belspec_fn.replace(".yaml", ".ebnf")
        if not os.path.exists(ebnf_fn) or os.path.getmtime(belspec_fn) > os.path.getmtime(ebnf_fn):
            with open(belspec_fn, "r") as f:
                belspec = yaml.load(f, Loader=yaml.SafeLoader)

            tmpl_dir = os.path.dirname(tmpl_fn)
            tmpl_basename = os.path.basename(tmpl_fn)

            bel_major_version = belspec["version"].split(".")[0]

            env = jinja2.Environment(
                loader=jinja2.FileSystemLoader(tmpl_dir)
            )  # create environment for template
            template = env.get_template(tmpl_basename)  # get the template

            # replace template placeholders with appropriate variables
            relations_list = [
                (relation, belspec["relations"]["info"][relation]["abbreviation"])
                for relation in belspec["relations"]["info"]
            ]
            relations_list = sorted(list(itertools.chain(*relations_list)), key=len, reverse=True)

            functions_list = [
                (function, belspec["functions"]["info"][function]["abbreviation"])
                for function in belspec["functions"]["info"]
                if belspec["functions"]["info"][function]["type"] == "primary"
            ]
            functions_list = sorted(list(itertools.chain(*functions_list)), key=len, reverse=True)

            modifiers_list = [
                (function, belspec["functions"]["info"][function]["abbreviation"])
                for function in belspec["functions"]["info"]
                if belspec["functions"]["info"][function]["type"] == "modifier"
            ]
            modifiers_list = sorted(list(itertools.chain(*modifiers_list)), key=len, reverse=True)

            created_time = datetime.datetime.now().strftime("%B %d, %Y - %I:%M:%S%p")

            ebnf = template.render(
                functions=functions_list,
                m_functions=modifiers_list,
                relations=relations_list,
                bel_version=belspec["version"],
                bel_major_version=bel_major_version,
                created_time=created_time,
            )

            with open(ebnf_fn, "w") as f:
                f.write(ebnf)

            parser_fn = ebnf_fn.replace(".ebnf", "_parser.py")

            parser = tatsu.to_python_sourcecode(ebnf, filename=parser_fn)
            flag = True
            with open(parser_fn, "wt") as f:
                f.write(parser)

    if flag:
        # In case we created new parser modules
        importlib.invalidate_caches()
701548
def main():
    

    scheme_names = sorted(six.iterkeys(SCHEME))
    version_str = pkg_resources.get_distribution('ansi2html').version
    parser = optparse.OptionParser(
        usage=main.__doc__,
        version="%%prog %s" % version_str)
    parser.add_option(
        "-p", "--partial", dest="partial",
        default=False, action="store_true",
        help="Process lines as them come in.  No headers are produced.")
    parser.add_option(
        "-L", "--latex", dest="latex",
        default=False, action="store_true",
        help="Export as LaTeX instead of HTML.")
    parser.add_option(
        "-i", "--inline", dest="inline",
        default=False, action="store_true",
        help="Inline style without headers or template.")
    parser.add_option(
        "-H", "--headers", dest="headers",
        default=False, action="store_true",
        help="Just produce the <style> tag.")
    parser.add_option(
        "-f", '--font-size', dest='font_size', metavar='SIZE',
        default="normal",
        help="Set the global font size in the output.")
    parser.add_option(
        "-l", '--light-background', dest='light_background',
        default=False, action="store_true",
        help="Set output to 'light background' mode.")
    parser.add_option(
        "-W", '--no-line-wrap', dest='no_line_wrap',
        default=False, action="store_true",
        help="Disable line wrapping.")
    parser.add_option(
        "-a", '--linkify', dest='linkify',
        default=False, action="store_true",
        help="Transform URLs into <a> links.")
    parser.add_option(
        "-u", '--unescape', dest='escaped',
        default=True, action="store_false",
        help="Do not escape XML tags found in the input.")
    parser.add_option(
        "-m", '--markup-lines', dest="markup_lines",
        default=False, action="store_true",
        help="Surround lines with <span id='line-n'>..</span>.")
    parser.add_option(
        '--input-encoding', dest='input_encoding', metavar='ENCODING',
        default='utf-8',
        help="Specify input encoding")
    parser.add_option(
        '--output-encoding', dest='output_encoding', metavar='ENCODING',
        default='utf-8',
        help="Specify output encoding")
    parser.add_option(
        '-s', '--scheme', dest='scheme', metavar='SCHEME',
        default='ansi2html', choices=scheme_names,
        help=("Specify color palette scheme. Default: %%default. Choices: %s"
              % scheme_names))
    parser.add_option(
        '-t', '--title', dest='output_title',
        default='',
        help="Specify output title")

    opts, args = parser.parse_args()

    conv = Ansi2HTMLConverter(
        latex=opts.latex,
        inline=opts.inline,
        dark_bg=not opts.light_background,
        line_wrap=not opts.no_line_wrap,
        font_size=opts.font_size,
        linkify=opts.linkify,
        escaped=opts.escaped,
        markup_lines=opts.markup_lines,
        output_encoding=opts.output_encoding,
        scheme=opts.scheme,
        title=opts.output_title,
    )

    if six.PY3:
        try:
            sys.stdin = io.TextIOWrapper(sys.stdin.detach(), opts.input_encoding, "replace")
        except io.UnsupportedOperation:
            # This only fails in the test suite...
            pass

    def _read(input_bytes):
        if six.PY3:
            return input_bytes
        else:
            return input_bytes.decode(opts.input_encoding)

    def _print(output_unicode, end='\n'):
        if hasattr(sys.stdout, 'buffer'):
            output_bytes = (output_unicode + end).encode(opts.output_encoding)
            sys.stdout.buffer.write(output_bytes)
        elif not six.PY3:
            sys.stdout.write((output_unicode + end).encode(opts.output_encoding))
        else:
            sys.stdout.write(output_unicode + end)

    # Produce only the headers and quit
    if opts.headers:
        _print(conv.produce_headers(), end='')
        return

    full = not bool(opts.partial or opts.inline)
    if six.PY3:
        output = conv.convert("".join(sys.stdin.readlines()), full=full, ensure_trailing_newline=True)
        _print(output, end='')
    else:
        output = conv.convert(six.u("").join(
            map(_read, sys.stdin.readlines())
        ), full=full, ensure_trailing_newline=True)
        _print(output, end='')
30448
def data_loader(self, sentences, shuffle=False):
        """"""
        dataset = BertEmbeddingDataset(sentences, self.transform)
        return DataLoader(dataset=dataset, batch_size=self.batch_size, shuffle=shuffle)
323180
def tabbed_parsing_character_generator(tmp_dir, train):
  """"""
  character_vocab = text_encoder.ByteTextEncoder()
  filename = "parsing_{0}.pairs".format("train" if train else "dev")
  pair_filepath = os.path.join(tmp_dir, filename)
  return text_problems.text2text_generate_encoded(
      text_problems.text2text_txt_tab_iterator(pair_filepath), character_vocab)
978779
def dbfpack(fn, usecols=None):
    """"""

    loadfunc = pulldbf.dbf_asdict
    cp = ChannelPack(loadfunc)
    cp.load(fn, usecols)
    names = pulldbf.channel_names(fn, usecols)
    cp.set_channel_names(names)
    # cp.set_basefilemtime()
    return cp
348018
def build_parser():
    
    import argparse
    description = "A programmer's search tool, parallel and fast"
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('pattern', metavar='PATTERN', action='store',
                        help='a python re regular expression')
    parser.add_argument('--ignore-case', '-i',  dest='ignorecase', action='store_true',
                        default=False, help='ignore case when searching')
    parser.add_argument('--no-unicode', '-u', dest='unicode', action='store_false',
                        default=True, help='unicode-unfriendly searching')
    parser.add_argument('--no-multiline', '-l', dest='multiline',
                        action='store_false', default=True,
                        help='don\'t search over multiple lines')
    parser.add_argument('--dot-all', '-a', dest='dot_all',
                        action='store_true', default=False,
                        help='dot in PATTERN matches newline')
    parser.add_argument('--escape', '-e', dest='escape',
                        action='store_true', default=False,
                        help='treat PATTERN as a string instead of a regex')

    if sys.version_info >= (2, 6):
        parser.add_argument('--follow-links', '-s', dest='follow_links',
                            action='store_true', default=False,
                            help='follow symlinks (Python >= 2.6 only)')
    parser.add_argument('--hidden', '-n', dest='search_hidden',
                        action='store_true', default=False,
                        help='search hidden files and directories')
    parser.add_argument('--binary', '-b', dest='search_binary',
                        action='store_true', default=False,
                        help='search binary files')
    parser.add_argument('--no-colors', '-c', dest='use_ansi_colors',
                        action='store_false', default=True,
                        help="don't print ANSI colors")
    parser.add_argument('--stats', '-t', dest='print_stats',
                        action='store_true', default=False,
                        help='print statistics')
    parser.add_argument('--num-processes', '-p', dest='number_processes',
                        action='store', default=10, type=int,
                        help='number of child processes to concurrently search with')
    parser.add_argument('--exclude', '-x', metavar='PATH_PATTERN', dest='exclude_path_patterns',
                        action='append', default=[], type=str,
                        help='exclude paths matching PATH_PATTERN')
    parser.add_argument('--open-with', '-o', metavar='COMMAND',
                        dest='command_strings', action='append', default=[],
                        type=str,
                        help='run each COMMAND where COMMAND is a string with a placeholder, %%s, for the absolute path of the matched file')
    parser.add_argument('directory', metavar='DIRECTORY', nargs='?',
                        default=getcwd(), help='a directory to search in (default cwd)')
    return parser
1107476
def create(cls, train_ds, valid_ds, test_ds=None, path:PathOrStr='.', no_check:bool=False, bs=64, val_bs:int=None,
               num_workers:int=0, device:torch.device=None, collate_fn:Callable=data_collate,
               dl_tfms:Optional[Collection[Callable]]=None, bptt:int=70, backwards:bool=False, **dl_kwargs) -> DataBunch:
        ""
        datasets = cls._init_ds(train_ds, valid_ds, test_ds)
        val_bs = ifnone(val_bs, bs)
        datasets = [LanguageModelPreLoader(ds, shuffle=(i==0), bs=(bs if i==0 else val_bs), bptt=bptt, backwards=backwards)
                    for i,ds in enumerate(datasets)]
        val_bs = bs
        dls = [DataLoader(d, b, shuffle=False, **dl_kwargs) for d,b in zip(datasets, (bs,val_bs,val_bs,val_bs)) if d is not None]
        return cls(*dls, path=path, device=device, dl_tfms=dl_tfms, collate_fn=collate_fn, no_check=no_check)
329056
def specfn_quant_generator(specfiles, quantfiles, tag, ignore_tags):
    """"""
    for specfn, qfn in zip(specfiles, quantfiles):
        for quant_el in basereader.generate_xmltags(qfn, tag, ignore_tags):
            yield os.path.basename(specfn), quant_el
1342652
def build_model():
  
  # training data
  train_data_node = tf.placeholder(tf.float32,shape=(BATCH_SIZE, IMAGE_SIZE, IMAGE_SIZE, NUM_CHANNELS))
  train_labels_node = tf.placeholder(tf.float32,shape=(BATCH_SIZE, NUM_LABELS))

  validation_data_node= tf.placeholder(tf.float32,shape=(VALIDATION_SIZE, IMAGE_SIZE, IMAGE_SIZE, NUM_CHANNELS))
  test_data_node=tf.placeholder(tf.float32,shape=(TEST_SIZE,IMAGE_SIZE,IMAGE_SIZE,NUM_CHANNELS))
  # validation dataset held in a single constant node
  # validation_data_node = tf.constant(validation_data)
  # test_data_node = tf.constant(test_data)

  # LEARNABLE WEIGHT NODES SHARED BETWEEN
  conv1_weights = tf.Variable(tf.truncated_normal([5, 5, NUM_CHANNELS, 32],stddev=0.1,seed=SEED))
  conv1_biases = tf.Variable(tf.zeros([32]))
  conv2_weights = tf.Variable(tf.truncated_normal([5, 5, 32, 64],stddev=0.1,seed=SEED))
  conv2_biases = tf.Variable(tf.constant(0.1, shape=[64]))
  fc1_weights = tf.Variable(tf.truncated_normal([IMAGE_SIZE // 4 * IMAGE_SIZE // 4 * 64, 512],stddev=0.1,seed=SEED))
  fc1_biases = tf.Variable(tf.constant(0.1, shape=[512]))
  fc2_weights = tf.Variable(tf.truncated_normal([512, NUM_LABELS],stddev=0.1,seed=SEED))
  fc2_biases = tf.Variable(tf.constant(0.1, shape=[NUM_LABELS]))

  # LENET
  def build_lenet(data,train=False):
    # subroutine for wiring up nodes and weights to training and evaluation LeNets
    conv1 = tf.nn.conv2d(data,conv1_weights,strides=[1, 1, 1, 1],padding='SAME')
    relu1 = tf.nn.relu(tf.nn.bias_add(conv1, conv1_biases))
    pool1 = tf.nn.max_pool(relu1,ksize=[1, 2, 2, 1],strides=[1, 2, 2, 1],padding='SAME')
    conv2 = tf.nn.conv2d(pool1,conv2_weights,strides=[1, 1, 1, 1],padding='SAME')
    relu2 = tf.nn.relu(tf.nn.bias_add(conv2, conv2_biases))
    pool2 = tf.nn.max_pool(relu2,ksize=[1, 2, 2, 1],strides=[1, 2, 2, 1],padding='SAME')
    # Reshape the feature map cuboid into a 2D matrix to feed it to the
    # fully connected layers.
    pool_shape = pool2.get_shape().as_list()
    reshape = tf.reshape(pool2,[pool_shape[0], pool_shape[1] * pool_shape[2] * pool_shape[3]])
    fc1 = tf.nn.relu(tf.matmul(reshape, fc1_weights) + fc1_biases)
    # Add a 50% dropout during training only. Dropout also scales
    # activations such that no rescaling is needed at evaluation time.
    if train:
      fc1 = tf.nn.dropout(fc1, 0.5, seed=SEED)
      # append summary ops to train
      _activation_summary(conv1)
      _activation_summary(fc1)

    fc2 = tf.matmul(fc1, fc2_weights) + fc2_biases
    return fc2

  # TRAINING LOSS / REGULARIZATION NODES
  logits = build_lenet(train_data_node, True)
  loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits, train_labels_node))

  tf.scalar_summary(loss.op.name,loss)

  regularizers = (tf.nn.l2_loss(fc1_weights) + tf.nn.l2_loss(fc1_biases) + tf.nn.l2_loss(fc2_weights) + tf.nn.l2_loss(fc2_biases))
  # Add the regularization term to the loss.
  loss += 5e-4 * regularizers

  # OPTIMIZER NODES
  batch = tf.Variable(0)
  # Decay once per epoch, using an exponential schedule starting at 0.01.
  learning_rate = tf.train.exponential_decay(
    0.01,                # Base learning rate.
    batch * BATCH_SIZE,  # Current index into the dataset.
    TRAIN_SIZE,          # Decay step.
    0.95,                # Decay rate.
    staircase=True)
  # Use simple momentum for the optimization.
  optimizer = tf.train.MomentumOptimizer(learning_rate,0.9).minimize(loss,global_step=batch)

  # # Predictions for the minibatch, validation set and test set.
  train_prediction = tf.nn.softmax(logits)
  # # We'll compute them only once in a while by calling their {eval()} method.
  validation_prediction = tf.nn.softmax(build_lenet(validation_data_node))
  test_prediction = tf.nn.softmax(build_lenet(test_data_node))

  summaries=tf.merge_all_summaries()

  # return input nodes and output nodes
  return (train_data_node,
    train_labels_node,
    validation_data_node,
    test_data_node,
    train_prediction,
    validation_prediction,
    test_prediction,
    conv1_weights,
    conv2_weights,
    fc1_weights,
    fc2_weights,
    optimizer,
    loss,
    learning_rate,
    summaries)
366024
def create_parser():
    

    parser = ArgumentParser(
        prog='epubcheck',
        description="EpubCheck v%s - Validate your ebooks" % __version__
    )

    # Arguments
    parser.add_argument(
        'path',
        nargs='?',
        default=getcwd(),
        help="Path to EPUB-file or folder for batch validation. "
             "The current directory will be processed if this argument "
             "is not specified."
    )

    # Options
    parser.add_argument(
        '-x', '--xls', nargs='?', type=FileType(mode='wb'),
        const='epubcheck_report.xls',
        help='Create a detailed Excel report.'
    )

    parser.add_argument(
        '-c', '--csv', nargs='?', type=FileType(mode='wb'),
        const='epubcheck_report.csv',
        help='Create a CSV report.'
    )

    parser.add_argument(
        '-r', '--recursive', action='store_true',
        help='Recurse into subfolders.'
    )

    return parser
140952
def _create_sentence_objects(self):
        """"""
        sentence_objects = []
        sentences = sent_tokenize(self.raw, tokenizer=self.tokenizer)
        char_index = 0  # Keeps track of character index within the blob
        for sent in sentences:
            # Compute the start and end indices of the sentence
            # within the blob. This only works if the sentence splitter
            # does not perform any character replacements or changes to
            # white space.
            # Working: NLTKPunktTokenizer
            # Not working: PatternTokenizer
            try:
                start_index = self.raw.index(sent, char_index)
                char_index += len(sent)
                end_index = start_index + len(sent)
            except ValueError:
                start_index = None
                end_index = None
            # Sentences share the same models as their parent blob
            s = Sentence(
                sent,
                start_index=start_index,
                end_index=end_index,
                tokenizer=self.tokenizer,
                np_extractor=self.np_extractor,
                pos_tagger=self.pos_tagger,
                analyzer=self.analyzer,
                parser=self.parser,
                classifier=self.classifier)
            sentence_objects.append(s)
        return sentence_objects
232030
def generate_ngrams_subparser(subparsers):
    """"""
    parser = subparsers.add_parser(
        'ngrams', description=constants.NGRAMS_DESCRIPTION,
        epilog=constants.NGRAMS_EPILOG, formatter_class=ParagraphFormatter,
        help=constants.NGRAMS_HELP)
    parser.set_defaults(func=generate_ngrams)
    utils.add_common_arguments(parser)
    parser.add_argument('-c', '--catalogue', dest='catalogue',
                        help=constants.NGRAMS_CATALOGUE_HELP,
                        metavar='CATALOGUE')
    utils.add_db_arguments(parser)
    utils.add_corpus_arguments(parser)
    parser.add_argument('min_size', help=constants.NGRAMS_MINIMUM_HELP,
                        metavar='MINIMUM', type=int)
    parser.add_argument('max_size', help=constants.NGRAMS_MAXIMUM_HELP,
                        metavar='MAXIMUM', type=int)
1183892
def create_parser() -> FileAwareParser:
    
    parser = FileAwareParser(description="Clear data from FHIR observation fact table", prog="removefacts",
                             use_defaults=False)
    parser.add_argument("-ss", "--sourcesystem", metavar="SOURCE SYSTEM CODE", help="Sourcesystem code")
    parser.add_argument("-u", "--uploadid", metavar="UPLOAD IDENTIFIER",
                        help="Upload identifer -- uniquely identifies this batch", type=int,
                        nargs='*')
    add_connection_args(parser, strong_config_file=False)
    parser.add_argument("-p", "--testprefix", metavar="SS PREFIX",
                        help=f"Sourcesystem_cd prefix for test suite functions (Default: {default_test_prefix}")
    parser.add_argument("--testlist", help="List leftover test suite entries", action="store_true")
    parser.add_argument("--removetestlist", help="Remove leftover test suite entries", action="store_true")
    return parser
1017077
def buildParser():
    ''' '''
    parser = argparse.ArgumentParser(description='Bagfile reader')
    parser.add_argument('-b', '--bag', help='Bag file to read',
                        required=True, type=str)
    parser.add_argument('-s', '--series',
                        help='Msg data fields to graph',
                        required=True, nargs='*')
    parser.add_argument('-y ', '--ylim',
                        help='Set min and max y lim',
                        required=False, nargs=2)
    parser.add_argument('-c', '--combined',
                        help="Graph them all on one",
                        required=False, action="store_true", dest="sharey")
    return parser
1214404
def generate_prepare_subparser(subparsers):
    """"""
    parser = subparsers.add_parser(
        'prepare', description=constants.PREPARE_DESCRIPTION,
        epilog=constants.PREPARE_EPILOG, formatter_class=ParagraphFormatter,
        help=constants.PREPARE_HELP)
    parser.set_defaults(func=prepare_xml)
    utils.add_common_arguments(parser)
    parser.add_argument('-s', '--source', dest='source',
                        choices=constants.TEI_SOURCE_CHOICES,
                        default=constants.TEI_SOURCE_CBETA_GITHUB,
                        help=constants.PREPARE_SOURCE_HELP,
                        metavar='SOURCE')
    parser.add_argument('input', help=constants.PREPARE_INPUT_HELP,
                        metavar='INPUT')
    parser.add_argument('output', help=constants.PREPARE_OUTPUT_HELP,
                        metavar='OUTPUT')
1002416
function parser (inputs, output, plugins, cb) {
  var data = {
    charset: 'UTF-8',
    headers: DEFAULT_HEADERS,
    translations: {
      context: {}
    }
  }

  var defaultContext = data.translations.context

  var headers = data.headers
  headers['plural-forms'] = headers['plural-forms'] || DEFAULT_HEADERS['plural-forms']
  headers['content-type'] = headers['content-type'] || DEFAULT_HEADERS['content-type']

  var nplurals = /nplurals ?= ?(\d)/.exec(headers['plural-forms'])[1]

  inputs
    .forEach(function (file) {
      var resolvedFilePath = path.join(process.cwd(), file)
      var src = fs.readFileSync(resolvedFilePath, 'utf8')

      try {
        var ast = babelParser.parse(src, {
          sourceType: 'module',
          plugins: ['jsx'].concat(plugins)
        })
      } catch (e) {
        console.error(`SyntaxError in ${file} (line: ${e.loc.line}, column: ${e.loc.column})`)
        process.exit(1)
      }

      walk.simple(ast.program, {
        CallExpression: function (node) {
          if (functionNames.hasOwnProperty(node.callee.name) ||
            node.callee.property && functionNames.hasOwnProperty(node.callee.property.name)) {
            var functionName = functionNames[node.callee.name] || functionNames[node.callee.property.name]
            var translate = {}

            var args = node.arguments
            for (var i = 0, l = args.length; i < l; i++) {
              var name = functionName[i]

              if (name && name !== 'count' && name !== 'domain') {
                var arg = args[i]
                var value = arg.value

                if (value) {
                  var line = node.loc.start.line
                  translate[name] = value
                  translate['comments'] = {
                    reference: file + ':' + line
                  }
                }

                if (name === 'msgid_plural') {
                  translate.msgstr = []
                  for (var p = 0; p < nplurals; p++) {
                    translate.msgstr[p] = ''
                  }
                }
              }
            }

            var context = defaultContext
            var msgctxt = translate.msgctxt

            if (msgctxt) {
              data.translations[msgctxt] = data.translations[msgctxt] || {}
              context = data.translations[msgctxt]
            }

            context[translate.msgid] = translate
          }
        }
      })
    })

  fs.writeFile(output, gettextParser.po.compile(data), function (err) {
    if (err) {
      cb(err)
    }
    cb(null)
  })
}
63075
def generate_base_provider_parser():
    """"""
    parser = argparse.ArgumentParser(add_help=False)
    parser.add_argument('action', help='specify the action to take', default='list',
                        choices=['create', 'list', 'update', 'delete'])
    parser.add_argument(
        'domain', help='specify the domain, supports subdomains as well')
    parser.add_argument('type', help='specify the entry type', default='TXT',
                        choices=['A', 'AAAA', 'CNAME', 'MX', 'NS', 'SOA', 'TXT', 'SRV', 'LOC'])

    parser.add_argument('--name', help='specify the record name')
    parser.add_argument('--content', help='specify the record content')
    parser.add_argument('--ttl', type=int,
                        help='specify the record time-to-live')
    parser.add_argument('--priority', help='specify the record priority')
    parser.add_argument(
        '--identifier', help='specify the record for update or delete actions')
    parser.add_argument('--log_level', help='specify the log level', default='ERROR',
                        choices=['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG', 'NOTSET'])
    parser.add_argument('--output',
                        help=('specify the type of output: by default a formatted table (TABLE), '
                              'a formatted table without header (TABLE-NO-HEADER), '
                              'a JSON string (JSON) or no output (QUIET)'),
                        default='TABLE', choices=['TABLE', 'TABLE-NO-HEADER', 'JSON', 'QUIET'])
    return parser