# Path: pysmi/reader/base.py
# class AbstractReader(object):
#     maxMibSize = 10000000  # MIBs can't be that large
#     fuzzyMatching = True  # try different file names while searching for MIB
#     originalMatching = uppercaseMatching = lowcaseMatching = True
#     exts = ['',
#             os.path.extsep + 'txt',
#             os.path.extsep + 'mib',
#             os.path.extsep + 'my']
#     exts.extend([x.upper() for x in exts if x])
# 
#     def setOptions(self, **kwargs):
#         for k in kwargs:
#             setattr(self, k, kwargs[k])
#         return self
# 
#     def getMibVariants(self, mibname, **options):
#         filenames = []
# 
#         if self.originalMatching:
#             filenames.append(mibname)
# 
#         if self.uppercaseMatching:
#             filenames.append(mibname.upper())
# 
#         if self.lowcaseMatching:
#             filenames.append(mibname.lower())
# 
#         if self.fuzzyMatching:
#             part = filenames[-1].find('-mib')
#             if part != -1:
#                 filenames.extend(
#                     [x[:part] for x in filenames]
#                 )
#             else:
#                 suffixed = mibname + '-mib'
#                 filenames.append(suffixed.upper())
#                 filenames.append(suffixed.lower())
# 
#         return ((x, x + y) for x in filenames
#                 for y in options.get('exts', self.exts))
# 
#     def getData(self, filename, **options):
#         raise NotImplementedError()
# 
# Path: pysmi/mibinfo.py
# class MibInfo(object):
#     #: actual MIB name
#     name = ''
# 
#     #: possible alternative to MIB name
#     alias = ''
# 
#     #: URL to MIB file
#     path = ''
# 
#     #: MIB file name
#     file = ''
# 
#     #: MIB file modification time
#     mtime = 0
# 
#     #: module OID
#     oid = ''
# 
#     #: MIB revision as `datetime`
#     revision = None
# 
#     #: all OIDs defined in this module
#     oids = ()
# 
#     #: MODULE-IDENTITY OID
#     identity = ''
# 
#     #: Enterprise OID
#     enterprise = ()
# 
#     #: MODULE-COMPLIANCE OIDs
#     compliance = ()
# 
#     #: imported MIB names
#     imported = ()
# 
#     def __init__(self, **kwargs):
#         for k in kwargs:
#             setattr(self, k, kwargs[k])
# 
# Path: pysmi/compat.py
# def decode(s):
#     if isinstance(s, bytes):
#         s = s.decode('utf-8', 'ignore')
#     return s
# 
# Path: pysmi/debug.py
# class Printer(object):
#     class NullHandler(logging.Handler):
# class Debug(object):
#     def __init__(self, logger=None, handler=None, formatter=None):
#     def __call__(self, msg):
#     def __str__(self):
#     def getCurrentLogger(self):
#         def emit(self, record):
#     def __init__(self, *flags, **options):
#     def __str__(self):
#     def __call__(self, msg):
#     def __and__(self, flag):
#     def __rand__(self, flag):
#     def getCurrentPrinter(self):
#     def getCurrentLogger(self):
# def setLogger(l):
# 
# Path: pysmi/error.py
# class PySmiError(Exception):
# class PySmiLexerError(PySmiError):
# class PySmiParserError(PySmiLexerError):
# class PySmiSyntaxError(PySmiParserError):
# class PySmiSearcherError(PySmiError):
# class PySmiFileNotModifiedError(PySmiSearcherError):
# class PySmiFileNotFoundError(PySmiSearcherError):
# class PySmiReaderError(PySmiError):
# class PySmiReaderFileNotModifiedError(PySmiReaderError):
# class PySmiReaderFileNotFoundError(PySmiReaderError):
# class PySmiCodegenError(PySmiError):
# class PySmiSemanticError(PySmiCodegenError):
# class PySmiWriterError(PySmiError):
#     def __init__(self, *args, **kwargs):
#     def __repr__(self):
#     def __str__(self):
#     def __str__(self):


import os
import sys
import time
from pysmi.reader.base import AbstractReader
from pysmi.mibinfo import MibInfo
from pysmi.compat import decode
from pysmi import debug
from pysmi import error
                debug.logger & debug.flagReader and debug.logger(
                    'loaded MIB index map from %s file, %s entries' % (indexFile, len(mibIndex)))

            except IOError:
                pass

        return mibIndex

    def getMibVariants(self, mibname, **options):
        if self.useIndexFile:
            if not self._indexLoaded:
                self._mibIndex = self.loadIndex(
                    os.path.join(self._path, self.indexFile)
                )
                self._indexLoaded = True

            if mibname in self._mibIndex:
                debug.logger & debug.flagReader and debug.logger(
                    'found %s in MIB index: %s' % (mibname, self._mibIndex[mibname]))
                return [(mibname, self._mibIndex[mibname])]

        return super(FileReader, self).getMibVariants(mibname, **options)

    def getData(self, mibname, **options):
        debug.logger & debug.flagReader and debug.logger(
            '%slooking for MIB %s' % (self._recursive and 'recursively ' or '', mibname))

        for path in self.getSubdirs(self._path, self._recursive, self._ignoreErrors):

            for mibalias, mibfile in self.getMibVariants(mibname, **options):

# Path: pysmi/reader/base.py
# class AbstractReader(object):
#     maxMibSize = 10000000  # MIBs can't be that large
#     fuzzyMatching = True  # try different file names while searching for MIB
#     originalMatching = uppercaseMatching = lowcaseMatching = True
#     exts = ['',
#             os.path.extsep + 'txt',
#             os.path.extsep + 'mib',
#             os.path.extsep + 'my']
#     exts.extend([x.upper() for x in exts if x])
# 
#     def setOptions(self, **kwargs):
#         for k in kwargs:
#             setattr(self, k, kwargs[k])
#         return self
# 
#     def getMibVariants(self, mibname, **options):
#         filenames = []
# 
#         if self.originalMatching:
#             filenames.append(mibname)
# 
#         if self.uppercaseMatching:
#             filenames.append(mibname.upper())
# 
#         if self.lowcaseMatching:
#             filenames.append(mibname.lower())
# 
#         if self.fuzzyMatching:
#             part = filenames[-1].find('-mib')
#             if part != -1:
#                 filenames.extend(
#                     [x[:part] for x in filenames]
#                 )
#             else:
#                 suffixed = mibname + '-mib'
#                 filenames.append(suffixed.upper())
#                 filenames.append(suffixed.lower())
# 
#         return ((x, x + y) for x in filenames
#                 for y in options.get('exts', self.exts))
# 
#     def getData(self, filename, **options):
#         raise NotImplementedError()
# 
# Path: pysmi/mibinfo.py
# class MibInfo(object):
#     #: actual MIB name
#     name = ''
# 
#     #: possible alternative to MIB name
#     alias = ''
# 
#     #: URL to MIB file
#     path = ''
# 
#     #: MIB file name
#     file = ''
# 
#     #: MIB file modification time
#     mtime = 0
# 
#     #: module OID
#     oid = ''
# 
#     #: MIB revision as `datetime`
#     revision = None
# 
#     #: all OIDs defined in this module
#     oids = ()
# 
#     #: MODULE-IDENTITY OID
#     identity = ''
# 
#     #: Enterprise OID
#     enterprise = ()
# 
#     #: MODULE-COMPLIANCE OIDs
#     compliance = ()
# 
#     #: imported MIB names
#     imported = ()
# 
#     def __init__(self, **kwargs):
#         for k in kwargs:
#             setattr(self, k, kwargs[k])
# 
# Path: pysmi/compat.py
# def decode(s):
#     if isinstance(s, bytes):
#         s = s.decode('utf-8', 'ignore')
#     return s
# 
# Path: pysmi/debug.py
# class Printer(object):
#     class NullHandler(logging.Handler):
# class Debug(object):
#     def __init__(self, logger=None, handler=None, formatter=None):
#     def __call__(self, msg):
#     def __str__(self):
#     def getCurrentLogger(self):
#         def emit(self, record):
#     def __init__(self, *flags, **options):
#     def __str__(self):
#     def __call__(self, msg):
#     def __and__(self, flag):
#     def __rand__(self, flag):
#     def getCurrentPrinter(self):
#     def getCurrentLogger(self):
# def setLogger(l):
# 
# Path: pysmi/error.py
# class PySmiError(Exception):
# class PySmiLexerError(PySmiError):
# class PySmiParserError(PySmiLexerError):
# class PySmiSyntaxError(PySmiParserError):
# class PySmiSearcherError(PySmiError):
# class PySmiFileNotModifiedError(PySmiSearcherError):
# class PySmiFileNotFoundError(PySmiSearcherError):
# class PySmiReaderError(PySmiError):
# class PySmiReaderFileNotModifiedError(PySmiReaderError):
# class PySmiReaderFileNotFoundError(PySmiReaderError):
# class PySmiCodegenError(PySmiError):
# class PySmiSemanticError(PySmiCodegenError):
# class PySmiWriterError(PySmiError):
#     def __init__(self, *args, **kwargs):
#     def __repr__(self):
#     def __str__(self):
#     def __str__(self):


# Path: pysmi/reader/localfile.py
import os
import sys
import time
from pysmi.reader.base import AbstractReader
from pysmi.mibinfo import MibInfo
from pysmi.compat import decode
from pysmi import debug
from pysmi import error

                debug.logger & debug.flagReader and debug.logger(
                    'loaded MIB index map from %s file, %s entries' % (indexFile, len(mibIndex)))

            except IOError:
                pass

        return mibIndex

    def getMibVariants(self, mibname, **options):
        if self.useIndexFile:
            if not self._indexLoaded:
                self._mibIndex = self.loadIndex(
                    os.path.join(self._path, self.indexFile)
                )
                self._indexLoaded = True

            if mibname in self._mibIndex:
                debug.logger & debug.flagReader and debug.logger(
                    'found %s in MIB index: %s' % (mibname, self._mibIndex[mibname]))
                return [(mibname, self._mibIndex[mibname])]

        return super(FileReader, self).getMibVariants(mibname, **options)

    def getData(self, mibname, **options):
        debug.logger & debug.flagReader and debug.logger(
            '%slooking for MIB %s' % (self._recursive and 'recursively ' or '', mibname))

        for path in self.getSubdirs(self._path, self._recursive, self._ignoreErrors):

            for mibalias, mibfile in self.getMibVariants(mibname, **options):

                f = os.path.join(decode(path), decode(mibfile))