# Path: tlfp/tools/common.py
# def open_json(dirpath, filename=None):
#     if filename:
#         path = os.path.join(dirpath, filename)
#     else:
#         path = dirpath
#     try:
#         with open(path, 'r') as f:
#             return json.load(f)
#     except Exception as e:
#         print(type(e), e, file=sys.stderr)
#         sys.stderr.write("ERROR: Could not open file %s" % (path,))
#         raise e


import sys
    import glob
from .common import open_json

        test = test_test(step_proc, step_me)

        # test('date')
        test('institution')
        test('stage')
        test('step')
        test('source_url')
        myprint()

    myprint('NOK:', score_nok)
    myprint('OK:', score_ok)
    return score_nok, score_ok

if __name__ == '__main__':

    sum_ok = 0
    sum_nok = 0
    missing = 0
    perfect = 0
    less_than_1 = 0

    all_doslegs = open_json(sys.argv[2])
    lafabrique_doslegs = list(sorted(glob.glob(sys.argv[1])))
    scored = []
    for file in lafabrique_doslegs:
        print('======')
        print('======')
        print(file)
        me = None

# Path: tlfp/tools/common.py
# def open_json(dirpath, filename=None):
#     if filename:
#         path = os.path.join(dirpath, filename)
#     else:
#         path = dirpath
#     try:
#         with open(path, 'r') as f:
#             return json.load(f)
#     except Exception as e:
#         print(type(e), e, file=sys.stderr)
#         sys.stderr.write("ERROR: Could not open file %s" % (path,))
#         raise e


# Path: tlfp/tools/compare_all_thelawfactory_and_me.py
import sys
    import glob
from .common import open_json


        test = test_test(step_proc, step_me)

        # test('date')
        test('institution')
        test('stage')
        test('step')
        test('source_url')
        myprint()

    myprint('NOK:', score_nok)
    myprint('OK:', score_ok)
    return score_nok, score_ok

if __name__ == '__main__':

    sum_ok = 0
    sum_nok = 0
    missing = 0
    perfect = 0
    less_than_1 = 0

    all_doslegs = open_json(sys.argv[2])
    lafabrique_doslegs = list(sorted(glob.glob(sys.argv[1])))
    scored = []
    for file in lafabrique_doslegs:
        print('======')
        print('======')
        print(file)
        me = None

        proc = open_json(file)