<commit_before>import os
import sys

XQUERY_CLIENT = os.environ['XQUERY_CLIENT']
query = os.path.join(os.environ['TSTSRCDIR'],'serialization-query.xq')
query_no_attr = os.path.join(os.environ['TSTSRCDIR'],'serialization-query_no_attr.xq')

for mode in ['xml', 'xml-typed', 'xml-noheader', 'xml-noroot', 'xml-root-name', 'dm', 'seq', 'text']:
    sys.stdout.write('\nmode="%s"\n' % mode)
    sys.stderr.write('\nmode="%s"\n' % mode)
    sys.stdout.flush()
    sys.stderr.flush()
    os.system('%s -f%s %s' % (XQUERY_CLIENT, mode, query))
    sys.stdout.flush()
    sys.stderr.flush()

mode='text'
sys.stdout.write('\nmode="%s" (w/o top-level attribute)\n' % mode)
sys.stderr.write('\nmode="%s" (w/o top-level attribute)\n' % mode)
sys.stdout.flush()
sys.stderr.flush()
os.system('%s -f%s "%s"' % (XQUERY_CLIENT, mode, query_no_attr))
sys.stdout.flush()
sys.stderr.flush()

sys.stdout.write('\nmode="" (default)\n')
sys.stderr.write('\nmode="" (default)\n')
sys.stdout.flush()
sys.stderr.flush()
os.system('%s "%s"' % (XQUERY_CLIENT, query))
sys.stdout.flush()
sys.stderr.flush()
<commit_msg>Add quotes around file name: it may contain spaces.<commit_after>import os
import sys

XQUERY_CLIENT = os.environ['XQUERY_CLIENT']
query = os.path.join(os.environ['TSTSRCDIR'],'serialization-query.xq')
query_no_attr = os.path.join(os.environ['TSTSRCDIR'],'serialization-query_no_attr.xq')

for mode in ['xml', 'xml-typed', 'xml-noheader', 'xml-noroot', 'xml-root-name', 'dm', 'seq', 'text']:
    sys.stdout.write('\nmode="%s"\n' % mode)
    sys.stderr.write('\nmode="%s"\n' % mode)
    sys.stdout.flush()
    sys.stderr.flush()
    os.system('%s -f%s "%s"' % (XQUERY_CLIENT, mode, query))
    sys.stdout.flush()
    sys.stderr.flush()

mode='text'
sys.stdout.write('\nmode="%s" (w/o top-level attribute)\n' % mode)
sys.stderr.write('\nmode="%s" (w/o top-level attribute)\n' % mode)
sys.stdout.flush()
sys.stderr.flush()
os.system('%s -f%s "%s"' % (XQUERY_CLIENT, mode, query_no_attr))
sys.stdout.flush()
sys.stderr.flush()

sys.stdout.write('\nmode="" (default)\n')
sys.stderr.write('\nmode="" (default)\n')
sys.stdout.flush()
sys.stderr.flush()
os.system('%s "%s"' % (XQUERY_CLIENT, query))
sys.stdout.flush()
sys.stderr.flush()

{'fraction_non_alphanumeric': 0.22702702702702704, 'fraction_numerical': 0.0, 'mean_word_length': 4.906914893617022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '2010809', 'n_tokens_mistral': 877, 'n_tokens_neox': 903, 'n_words': 144}