# Path: stestr/repository/abstract.py
# class AbstractRepositoryFactory:
# class AbstractRepository:
# class AbstractTestRun:
# class RepositoryNotFound(Exception):
#     def initialise(self, url):
#     def open(self, url):
#     def count(self):
#     def get_failing(self):
#     def get_run_ids(self):
#     def remove_run_id(self, run_id):
#     def get_inserter(self, partial=False, run_id=None, metadata=None):
#     def _get_inserter(self, partial=False, run_id=None, metadata=None):
#     def get_latest_run(self):
#     def get_test_run(self, run_id):
#     def get_test_times(self, test_ids):
#     def _get_test_times(self, test_ids):
#     def latest_id(self):
#     def get_test_ids(self, run_id):
#         def gather(test_dict):
#     def find_metadata(self, metadata):
#     def get_id(self):
#     def get_subunit_stream(self):
#     def get_test(self):
#     def get_metadata(self):
#     def __init__(self, url):


from extras import try_import
from io import BytesIO
from operator import methodcaller
from stestr.repository import abstract as repository
import subunit
import testtools
    def get_run_ids(self):
        return list(self._runs.keys())

    def remove_run_id(self, run_id):
        if run_id not in self._runs:
            raise KeyError("No run %s in repository" % run_id)
        del self._run[run_id]

    def latest_id(self):
        result = self.count() - 1
        if result < 0:
            raise KeyError("No tests in repository")
        return result

    def _get_inserter(self, partial, run_id=None, metadata=None):
        return _Inserter(self, partial, run_id, metadata)

    def _get_test_times(self, test_ids):
        result = {}
        for test_id in test_ids:
            duration = self._times.get(test_id, None)
            if duration is not None:
                result[test_id] = duration
        return result


# XXX: Too much duplication between this and _Inserter
class _Failures(repository.AbstractTestRun):
    """Report on failures from a memory repository."""


# Path: stestr/repository/abstract.py
# class AbstractRepositoryFactory:
# class AbstractRepository:
# class AbstractTestRun:
# class RepositoryNotFound(Exception):
#     def initialise(self, url):
#     def open(self, url):
#     def count(self):
#     def get_failing(self):
#     def get_run_ids(self):
#     def remove_run_id(self, run_id):
#     def get_inserter(self, partial=False, run_id=None, metadata=None):
#     def _get_inserter(self, partial=False, run_id=None, metadata=None):
#     def get_latest_run(self):
#     def get_test_run(self, run_id):
#     def get_test_times(self, test_ids):
#     def _get_test_times(self, test_ids):
#     def latest_id(self):
#     def get_test_ids(self, run_id):
#         def gather(test_dict):
#     def find_metadata(self, metadata):
#     def get_id(self):
#     def get_subunit_stream(self):
#     def get_test(self):
#     def get_metadata(self):
#     def __init__(self, url):


# Path: stestr/repository/memory.py
from extras import try_import
from io import BytesIO
from operator import methodcaller
from stestr.repository import abstract as repository
import subunit
import testtools

    def get_run_ids(self):
        return list(self._runs.keys())

    def remove_run_id(self, run_id):
        if run_id not in self._runs:
            raise KeyError("No run %s in repository" % run_id)
        del self._run[run_id]

    def latest_id(self):
        result = self.count() - 1
        if result < 0:
            raise KeyError("No tests in repository")
        return result

    def _get_inserter(self, partial, run_id=None, metadata=None):
        return _Inserter(self, partial, run_id, metadata)

    def _get_test_times(self, test_ids):
        result = {}
        for test_id in test_ids:
            duration = self._times.get(test_id, None)
            if duration is not None:
                result[test_id] = duration
        return result


# XXX: Too much duplication between this and _Inserter
class _Failures(repository.AbstractTestRun):
    """Report on failures from a memory repository."""


    def __init__(self, repository):