<commit_before>#!/usr/bin/env python
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.


def log(msg):
    import sys
    sys.stderr.write("%s\n" % msg)


def test_import():
    try:
        import vistk.pipeline.process
    except:
        log("Error: Failed to import the process module")


def test_create():
    from vistk.pipeline import process

    process.ProcessName()
    process.ProcessNames()
    process.PortDescription()
    process.Port()
    process.Ports()
    process.PortType()
    process.PortFlag()
    process.PortFlags()
    process.PortAddr()
    process.PortAddrs()


def test_api_calls():
    from vistk.pipeline import process

    a = process.PortAddr()
    a.process
    a.port
    a.process = ''
    a.port = ''


def main(testname):
    if testname == 'import':
        test_import()
    elif testname == 'create':
        test_create()
    elif testname == 'api_calls':
        test_api_calls()
    else:
        log("Error: No such test '%s'" % testname)


if __name__ == '__main__':
    import os
    import sys

    if not len(sys.argv) == 4:
        log("Error: Expected three arguments")
        sys.exit(1)

    testname = sys.argv[1]

    os.chdir(sys.argv[2])

    sys.path.append(sys.argv[3])

    main(testname)
<commit_msg>Test wrapped process info structures<commit_after>#!/usr/bin/env python
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.


def log(msg):
    import sys
    sys.stderr.write("%s\n" % msg)


def test_import():
    try:
        import vistk.pipeline.process
    except:
        log("Error: Failed to import the process module")


def test_create():
    from vistk.pipeline import datum
    from vistk.pipeline import process

    process.ProcessName()
    process.ProcessNames()
    process.PortDescription()
    process.Port()
    process.Ports()
    process.PortType()
    process.PortFlag()
    process.PortFlags()
    process.PortAddr()
    process.PortAddrs()
    process.PortInfo('type', process.PortFlags(), 'desc')
    process.ConfInfo('default', 'desc')
    process.DataInfo(True, True, datum.DatumType.INVALID)


def test_api_calls():
    from vistk.pipeline import datum
    from vistk.pipeline import process

    a = process.PortAddr()
    a.process
    a.port
    a.process = ''
    a.port = ''

    a = process.PortInfo('type', process.PortFlags(), 'desc')
    a.type
    a.flags
    a.description

    a = process.ConfInfo('default', 'desc')
    a.default
    a.description

    a = process.DataInfo(True, True, datum.DatumType.INVALID)
    a.same_color
    a.in_sync
    a.max_status


def main(testname):
    if testname == 'import':
        test_import()
    elif testname == 'create':
        test_create()
    elif testname == 'api_calls':
        test_api_calls()
    else:
        log("Error: No such test '%s'" % testname)


if __name__ == '__main__':
    import os
    import sys

    if not len(sys.argv) == 4:
        log("Error: Expected three arguments")
        sys.exit(1)

    testname = sys.argv[1]

    os.chdir(sys.argv[2])

    sys.path.append(sys.argv[3])

    main(testname)

{'fraction_non_alphanumeric': 0.12100791092880164, 'fraction_numerical': 0.009961910342806914, 'mean_word_length': 2.7765486725663715, 'pattern_counts': {'":': 0, '<': 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': '7375783', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1102, 'n_words': 281}