# Path: sampletester/parser.py
# SCHEMA_TYPE_KEY = 'type'
# SCHEMA_TYPE_ABSENT = '(no type)' # for indexing docs with no SCHEMA_TYPE_KEY
# SCHEMA_TYPE_SEPARATOR = '/'
# SCHEMA_VERSION_KEY = 'schema_version'
# class SchemaDescriptor:
# class IndexedDocs(object):
# class YamlDocSyntaxError(Exception):
#   def __post_init__(self) -> str:
#   def has_version(self) -> bool:
#   def __init__(self,
#                strict: bool = False,
#                resolver: Callable[[Document], str] = None):
#   def contains(self, *type_names: str) -> bool:
#   def from_files(self, *paths: str):
#   def from_strings(self, *sources: Tuple[str, str]):
#   def add(self, content:str, file_name: str):
#   def add_documents(self, *documents: Document):
#   def of_type(self, type_name: str) -> List[Document]:
#   def resolve_uncategorized(self):
# def only_files_in(paths: Iterable[str]) -> Set[str]:


import io
import logging
import os.path
import yaml
from sampletester import parser
from typing import Iterable
  SETS_KEY_v1v2 = 'sets'
  ELEMENTS_KEY_v1v2 = '__items__'

  def __init__(self, *indices: str):
    """Initializes manifest.

    Args:
      indices: An optional list of labels by which to index the manifest read in
        from various sources
    """
    self.interpreter = {
        '1': self.index_source_v1,
        '2': self.index_source_v2,
        '3': self.index_source_v3
    }

    # tags[key1][key2]...[keyn] == [metadata, metadata, ...]
    # eg with self.indices == ["language", "sample"]:
    #    tags["python"]["analyze_sentiment"] = [ sentiment_john_meta, sentiment_mary_meta ]
    self.tags = {}

    # sources is a list of (name, parsed-yaml, interpreter) tuples, set by
    # read_sources() and used by index()
    self.sources = []

    self.set_indices(*indices)

  def set_indices(self, *indices: str):
    self.indices = indices or [None]


# Path: sampletester/parser.py
# SCHEMA_TYPE_KEY = 'type'
# SCHEMA_TYPE_ABSENT = '(no type)' # for indexing docs with no SCHEMA_TYPE_KEY
# SCHEMA_TYPE_SEPARATOR = '/'
# SCHEMA_VERSION_KEY = 'schema_version'
# class SchemaDescriptor:
# class IndexedDocs(object):
# class YamlDocSyntaxError(Exception):
#   def __post_init__(self) -> str:
#   def has_version(self) -> bool:
#   def __init__(self,
#                strict: bool = False,
#                resolver: Callable[[Document], str] = None):
#   def contains(self, *type_names: str) -> bool:
#   def from_files(self, *paths: str):
#   def from_strings(self, *sources: Tuple[str, str]):
#   def add(self, content:str, file_name: str):
#   def add_documents(self, *documents: Document):
#   def of_type(self, type_name: str) -> List[Document]:
#   def resolve_uncategorized(self):
# def only_files_in(paths: Iterable[str]) -> Set[str]:


# Path: sampletester/sample_manifest.py
import io
import logging
import os.path
import yaml
from sampletester import parser
from typing import Iterable

  SETS_KEY_v1v2 = 'sets'
  ELEMENTS_KEY_v1v2 = '__items__'

  def __init__(self, *indices: str):
    """Initializes manifest.

    Args:
      indices: An optional list of labels by which to index the manifest read in
        from various sources
    """
    self.interpreter = {
        '1': self.index_source_v1,
        '2': self.index_source_v2,
        '3': self.index_source_v3
    }

    # tags[key1][key2]...[keyn] == [metadata, metadata, ...]
    # eg with self.indices == ["language", "sample"]:
    #    tags["python"]["analyze_sentiment"] = [ sentiment_john_meta, sentiment_mary_meta ]
    self.tags = {}

    # sources is a list of (name, parsed-yaml, interpreter) tuples, set by
    # read_sources() and used by index()
    self.sources = []

    self.set_indices(*indices)

  def set_indices(self, *indices: str):
    self.indices = indices or [None]


  def from_docs(self, indexed_docs: parser.IndexedDocs):