# Path: dnf/module/exceptions.py
# class EnableMultipleStreamsException(dnf.exceptions.Error):
#     def __init__(self, module_spec, value=None):
#         if value is None:
#             value = _("Cannot enable more streams from module '{}' at the same time").format(module_spec)
#         super(EnableMultipleStreamsException, self).__init__(value)
# 
# Path: dnf/util.py
# MAIN_PROG = argparse.ArgumentParser().prog if argparse.ArgumentParser().prog == "yum" else "dnf"
# MAIN_PROG_UPPER = MAIN_PROG.upper()
# def _parse_specs(namespace, values):
# def _urlopen_progress(url, conf, progress=None):
# def _urlopen(url, conf=None, repo=None, mode='w+b', **kwargs):
# def rtrim(s, r):
# def am_i_root():
# def clear_dir(path):
# def ensure_dir(dname):
# def split_path(path):
# def empty(iterable):
# def first(iterable):
# def first_not_none(iterable):
# def file_age(fn):
# def file_timestamp(fn):
# def get_effective_login():
# def get_in(dct, keys, not_found):
# def group_by_filter(fn, iterable):
#     def splitter(acc, item):
# def insert_if(item, iterable, condition):
# def is_exhausted(iterator):
# def is_glob_pattern(pattern):
# def is_string_type(obj):
# def lazyattr(attrname):
#     def get_decorated(fn):
#         def cached_getter(obj):
# def mapall(fn, *seq):
# def normalize_time(timestamp):
# def on_ac_power():
# def on_metered_connection():
# def partition(pred, iterable):
# def rm_rf(path):
# def split_by(iterable, condition):
#     def next_subsequence(it):
# def strip_prefix(s, prefix):
# def touch(path, no_create=False):
# def _terminal_messenger(tp='write', msg="", out=sys.stdout):
# def _format_resolve_problems(resolve_problems):
# def _te_nevra(te):
# def _log_rpm_trans_with_swdb(rpm_transaction, swdb_transaction):
# def _sync_rpm_trans_with_swdb(rpm_transaction, swdb_transaction):
#     def __init__(self):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def __init__(self, *args, **kwds):
#     def __hash__(self):
#     def __init__(self, iterable):
#     def __getattr__(self, what):
#         def fn(*args, **kwargs):
#             def call_what(v):
#     def __setattr__(self, what, val):
#         def setter(item):
# def _make_lists(transaction):
# def _post_transaction_output(base, transaction, action_callback):
#     def _tsi_or_pkg_nevra_cmp(item1, item2):
# def _name_unset_wrapper(input_name):
# class tmpdir(object):
# class Bunch(dict):
# class MultiCallList(list):
# 
# Path: dnf/i18n.py
# class UnicodeStream(object):
#     def __init__(self, stream, encoding):
#     def write(self, s):
#     def __getattr__(self, name):
# def _full_ucd_support(encoding):
# def _guess_encoding():
# def setup_locale():
# def setup_stdout():
# def ucd_input(ucstring):
# def ucd(obj):
# def _exact_width_char(uchar):
# def chop_str(msg, chop=None):
# def exact_width(msg):
# def fill_exact_width(msg, fill, chop=None, left=True, prefix='', suffix=''):
# def textwrap_fill(text, width=70, initial_indent='', subsequent_indent=''):
#     def _indent_at_beg(line):
# def select_short_long(width, msg_short, msg_long):
# def translation(name):
#     def ucd_wrapper(fnc):
# def pgettext(context, message):
# _, P_ = translation("dnf")
# C_ = pgettext


from collections import OrderedDict
from dnf.module.exceptions import EnableMultipleStreamsException
from dnf.util import logger
from dnf.i18n import _, P_, ucd
import hawkey
import libdnf.smartcols
import libdnf.module
import dnf.selector
import dnf.exceptions
import functools
        modules = []
        if module_specs:
            for spec in module_specs:
                module_list, nsvcap = self._get_modules(spec)
                modules.extend(module_list)
        else:
            modules = self.base._moduleContainer.getModulePackages()
        latest = self.base._moduleContainer.getLatestModulesPerRepo(module_state, modules)
        if not latest:
            return ""

        table = self._create_and_fill_table(latest)
        current_repo_id_index = 0
        already_printed_lines = 0
        try:
            repo_name = self.base.repos[latest[0][0][0].getRepoID()].name
        except KeyError:
            repo_name = latest[0][0][0].getRepoID()
        versions = len(latest[0])
        header = self._format_header(table)
        str_table = self._format_repoid(repo_name)
        str_table += header
        for i in range(0, table.getNumberOfLines()):
            if versions + already_printed_lines <= i:
                already_printed_lines += versions
                current_repo_id_index += 1
                # Fail-Safe repository is not in self.base.repos
                try:
                    repo_name = self.base.repos[
                        latest[current_repo_id_index][0][0].getRepoID()].name

# Path: dnf/module/exceptions.py
# class EnableMultipleStreamsException(dnf.exceptions.Error):
#     def __init__(self, module_spec, value=None):
#         if value is None:
#             value = _("Cannot enable more streams from module '{}' at the same time").format(module_spec)
#         super(EnableMultipleStreamsException, self).__init__(value)
# 
# Path: dnf/util.py
# MAIN_PROG = argparse.ArgumentParser().prog if argparse.ArgumentParser().prog == "yum" else "dnf"
# MAIN_PROG_UPPER = MAIN_PROG.upper()
# def _parse_specs(namespace, values):
# def _urlopen_progress(url, conf, progress=None):
# def _urlopen(url, conf=None, repo=None, mode='w+b', **kwargs):
# def rtrim(s, r):
# def am_i_root():
# def clear_dir(path):
# def ensure_dir(dname):
# def split_path(path):
# def empty(iterable):
# def first(iterable):
# def first_not_none(iterable):
# def file_age(fn):
# def file_timestamp(fn):
# def get_effective_login():
# def get_in(dct, keys, not_found):
# def group_by_filter(fn, iterable):
#     def splitter(acc, item):
# def insert_if(item, iterable, condition):
# def is_exhausted(iterator):
# def is_glob_pattern(pattern):
# def is_string_type(obj):
# def lazyattr(attrname):
#     def get_decorated(fn):
#         def cached_getter(obj):
# def mapall(fn, *seq):
# def normalize_time(timestamp):
# def on_ac_power():
# def on_metered_connection():
# def partition(pred, iterable):
# def rm_rf(path):
# def split_by(iterable, condition):
#     def next_subsequence(it):
# def strip_prefix(s, prefix):
# def touch(path, no_create=False):
# def _terminal_messenger(tp='write', msg="", out=sys.stdout):
# def _format_resolve_problems(resolve_problems):
# def _te_nevra(te):
# def _log_rpm_trans_with_swdb(rpm_transaction, swdb_transaction):
# def _sync_rpm_trans_with_swdb(rpm_transaction, swdb_transaction):
#     def __init__(self):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def __init__(self, *args, **kwds):
#     def __hash__(self):
#     def __init__(self, iterable):
#     def __getattr__(self, what):
#         def fn(*args, **kwargs):
#             def call_what(v):
#     def __setattr__(self, what, val):
#         def setter(item):
# def _make_lists(transaction):
# def _post_transaction_output(base, transaction, action_callback):
#     def _tsi_or_pkg_nevra_cmp(item1, item2):
# def _name_unset_wrapper(input_name):
# class tmpdir(object):
# class Bunch(dict):
# class MultiCallList(list):
# 
# Path: dnf/i18n.py
# class UnicodeStream(object):
#     def __init__(self, stream, encoding):
#     def write(self, s):
#     def __getattr__(self, name):
# def _full_ucd_support(encoding):
# def _guess_encoding():
# def setup_locale():
# def setup_stdout():
# def ucd_input(ucstring):
# def ucd(obj):
# def _exact_width_char(uchar):
# def chop_str(msg, chop=None):
# def exact_width(msg):
# def fill_exact_width(msg, fill, chop=None, left=True, prefix='', suffix=''):
# def textwrap_fill(text, width=70, initial_indent='', subsequent_indent=''):
#     def _indent_at_beg(line):
# def select_short_long(width, msg_short, msg_long):
# def translation(name):
#     def ucd_wrapper(fnc):
# def pgettext(context, message):
# _, P_ = translation("dnf")
# C_ = pgettext


# Path: dnf/module/module_base.py
from collections import OrderedDict
from dnf.module.exceptions import EnableMultipleStreamsException
from dnf.util import logger
from dnf.i18n import _, P_, ucd
import hawkey
import libdnf.smartcols
import libdnf.module
import dnf.selector
import dnf.exceptions
import functools

        modules = []
        if module_specs:
            for spec in module_specs:
                module_list, nsvcap = self._get_modules(spec)
                modules.extend(module_list)
        else:
            modules = self.base._moduleContainer.getModulePackages()
        latest = self.base._moduleContainer.getLatestModulesPerRepo(module_state, modules)
        if not latest:
            return ""

        table = self._create_and_fill_table(latest)
        current_repo_id_index = 0
        already_printed_lines = 0
        try:
            repo_name = self.base.repos[latest[0][0][0].getRepoID()].name
        except KeyError:
            repo_name = latest[0][0][0].getRepoID()
        versions = len(latest[0])
        header = self._format_header(table)
        str_table = self._format_repoid(repo_name)
        str_table += header
        for i in range(0, table.getNumberOfLines()):
            if versions + already_printed_lines <= i:
                already_printed_lines += versions
                current_repo_id_index += 1
                # Fail-Safe repository is not in self.base.repos
                try:
                    repo_name = self.base.repos[
                        latest[current_repo_id_index][0][0].getRepoID()].name

                except KeyError: