# Path: stestr/config_file.py
# class TestrConf:
#     def __init__(self, config_file, section='DEFAULT'):
#     def _sanitize_path(self, path):
#     def get_run_command(self, test_ids=None, regexes=None,
#                         test_path=None, top_dir=None, group_regex=None,
#                         repo_type='file', repo_url=None,
#                         serial=False, worker_path=None,
#                         concurrency=0,
#                         exclude_list=None,
#                         include_list=None,
#                         exclude_regex=None,
#                         randomize=False, parallel_class=None):
#             def group_callback(test_id, regex=re.compile(group_regex)):
# 
# Path: stestr/output.py
# def output_table(table, output=sys.stdout):
#     def show_row(row):
# def output_tests(tests, output=sys.stdout):
# def make_result(get_id, output=sys.stdout):
# def output_summary(successful, tests, tests_delta, time, time_delta, values,
#                    output=sys.stdout):
# def output_stream(stream, output=sys.stdout):
#     def __init__(self, process):
#     def _append_return_code_as_test(self):
#     def read(self, count=-1):
#     def readline(self):
#     def readlines(self):
# class ReturnCodeToSubunit:


from io import BytesIO
from cliff import command
from stestr import config_file
from stestr import output
import os
import sys

    """
    ids = None
    if config and os.path.isfile(config):
        conf = config_file.TestrConf(config)
    elif os.path.isfile('tox.ini'):
        conf = config_file.TestrConf('tox.ini', section='stestr')
    else:
        conf = config_file.TestrConf(config)
    cmd = conf.get_run_command(
        regexes=filters, repo_type=repo_type,
        repo_url=repo_url, group_regex=group_regex,
        exclude_list=exclude_list,
        include_list=include_list,
        exclude_regex=exclude_regex,
        test_path=test_path, top_dir=top_dir)
    not_filtered = filters is None\
        and include_list is None and exclude_list is None\
        and exclude_regex is None
    try:
        cmd.setUp()
        # List tests if the fixture has not already needed to to filter.
        if not_filtered:
            ids = cmd.list_tests()
        else:
            ids = cmd.test_ids
        stream = BytesIO()
        for id in ids:
            stream.write(('%s\n' % id).encode('utf8'))
        stream.seek(0)

# Path: stestr/config_file.py
# class TestrConf:
#     def __init__(self, config_file, section='DEFAULT'):
#     def _sanitize_path(self, path):
#     def get_run_command(self, test_ids=None, regexes=None,
#                         test_path=None, top_dir=None, group_regex=None,
#                         repo_type='file', repo_url=None,
#                         serial=False, worker_path=None,
#                         concurrency=0,
#                         exclude_list=None,
#                         include_list=None,
#                         exclude_regex=None,
#                         randomize=False, parallel_class=None):
#             def group_callback(test_id, regex=re.compile(group_regex)):
# 
# Path: stestr/output.py
# def output_table(table, output=sys.stdout):
#     def show_row(row):
# def output_tests(tests, output=sys.stdout):
# def make_result(get_id, output=sys.stdout):
# def output_summary(successful, tests, tests_delta, time, time_delta, values,
#                    output=sys.stdout):
# def output_stream(stream, output=sys.stdout):
#     def __init__(self, process):
#     def _append_return_code_as_test(self):
#     def read(self, count=-1):
#     def readline(self):
#     def readlines(self):
# class ReturnCodeToSubunit:


# Path: stestr/commands/list.py
from io import BytesIO
from cliff import command
from stestr import config_file
from stestr import output
import os
import sys


    """
    ids = None
    if config and os.path.isfile(config):
        conf = config_file.TestrConf(config)
    elif os.path.isfile('tox.ini'):
        conf = config_file.TestrConf('tox.ini', section='stestr')
    else:
        conf = config_file.TestrConf(config)
    cmd = conf.get_run_command(
        regexes=filters, repo_type=repo_type,
        repo_url=repo_url, group_regex=group_regex,
        exclude_list=exclude_list,
        include_list=include_list,
        exclude_regex=exclude_regex,
        test_path=test_path, top_dir=top_dir)
    not_filtered = filters is None\
        and include_list is None and exclude_list is None\
        and exclude_regex is None
    try:
        cmd.setUp()
        # List tests if the fixture has not already needed to to filter.
        if not_filtered:
            ids = cmd.list_tests()
        else:
            ids = cmd.test_ids
        stream = BytesIO()
        for id in ids:
            stream.write(('%s\n' % id).encode('utf8'))
        stream.seek(0)

        output.output_stream(stream, output=stdout)