<commit_before># -*- coding: utf-8  -*-
"""
Print a list of pages, as defined by page generator parameters

These parameters are supported to specify which pages titles to print:

&params;
"""
#
# (C) Pywikibot team, 2008-2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
#

import pywikibot
from pywikibot.pagegenerators import GeneratorFactory, parameterHelp

docuReplacements = {'&params;': parameterHelp}


def main(*args):
    gen = None
    genFactory = GeneratorFactory()
    for arg in pywikibot.handleArgs(*args):
        genFactory.handleArg(arg)
    gen = genFactory.getCombinedGenerator()
    if gen:
        i = 0
        for page in gen:
            i += 1
            pywikibot.stdout("%4d: %s" % (i, page.title()))
    else:
        pywikibot.showHelp()

if __name__ == "__main__":
    main()<commit_msg>Bug 64855 - get.py not ported from compat but added to listpages.py<commit_after># -*- coding: utf-8  -*-
"""
Print a list of pages, as defined by page generator parameters.
Optionally, it also prints page content to STDOUT.

These parameters are supported to specify which pages titles to print:

&params;

-notitle          Page title is not printed.

-get              Page content is printed.

"""
#
# (C) Pywikibot team, 2008-2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
#

import pywikibot
from pywikibot.pagegenerators import GeneratorFactory, parameterHelp

docuReplacements = {'&params;': parameterHelp}


def main(*args):
    gen = None
    notitle = False
    page_get = False

    genFactory = GeneratorFactory()
    for arg in pywikibot.handleArgs(*args):
        if arg == '-notitle':
            notitle = True
        elif arg == '-get':
            page_get = True
        else:
            genFactory.handleArg(arg)

    gen = genFactory.getCombinedGenerator()
    if gen:
        for i, page in enumerate(gen, start=1):
            if not notitle:
                pywikibot.stdout("%4d: %s" % (i, page.title()))
            if page_get:
                # TODO: catch exceptions
                pywikibot.output(page.text, toStdout=True)
    else:
        pywikibot.showHelp()

if __name__ == "__main__":
    main()
{'fraction_non_alphanumeric': 0.10685302073940486, 'fraction_numerical': 0.012623985572587917, 'mean_word_length': 2.6199021207177813, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6052048', 'n_tokens_mistral': 707, 'n_tokens_neox': 679, 'n_words': 217}