human
Complete this python program:
def main():
assistant
#Here is the Python code you requested.

    """Runs the tests.
    """
    def _iterate(test_suite_or_case):
        'Iterate    through    all    the    test    cases    in    `test_suite_or_case`.'
        try:
            suite = iter(test_suite_or_case)
        except TypeError:
            (yield test_suite_or_case)
        else:
            for test in suite:
                for subtest in _iterate(test):
                    (yield subtest)
    feconf.PLATFORM = 'gae'
    for directory in DIRS_TO_ADD_TO_SYS_PATH:
        if (not os.path.exists(os.path.dirname(directory))):
            raise Exception(('Directory    %s    does    not    exist.' % directory))
        sys.path.insert(0, directory)
    import dev_appserver
    dev_appserver.fix_sys_path()
    parsed_args = _PARSER.parse_args()
    suites = create_test_suites(parsed_args.test_target)
    results = [unittest.TextTestRunner(verbosity=2).run(suite) for suite in suites]
    tests_run = 0
    for result in results:
        tests_run += result.testsRun
        if (result.errors or result.failures):
            raise Exception(('Test    suite    failed:    %s    tests    run,    %s    errors,    %s    failures.' % (result.testsRun, len(result.errors), len(result.failures))))
    if (tests_run == 0):
        raise Exception('No    tests    were    run.')