# Path: bin/deps/astroid/interpreter/_import/spec.py
#     _HAS_MACHINERY = True
#     _HAS_MACHINERY = False
# _SPEC_FINDERS = (
#     ImpFinder,
#     ZipFinder,
# )
# def _imp_type_to_module_type(imp_type):
#     def __new__(cls, name, module_type, location=None, origin=None,
#                 submodule_search_locations=None):
#     def __init__(self, path=None):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def contribute_to_path(self, spec, processed):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def contribute_to_path(self, spec, processed):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def contribute_to_path(self, spec, processed):
#     def __init__(self, path):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def contribute_to_path(self, spec, processed):
# def _is_setuptools_namespace(location):
# def _cached_set_diff(left, right):
# def _precache_zipimporters(path=None):
# def _search_zip(modpath, pic):
# def _find_spec_with_path(search_path, modname, module_parts, processed, submodule_path):
# def find_spec(modpath, path=None):
# class ModuleSpec(_ModuleSpec):
# class Finder(object):
# class ImpFinder(Finder):
# class ExplicitNamespacePackageFinder(ImpFinder):
# class ZipFinder(Finder):
# class PathSpecFinder(Finder):


import imp
import os
import platform
import sys
import six
from distutils.sysconfig import get_python_lib # pylint: disable=import-error
from distutils.errors import DistutilsPlatformError
from .interpreter._import import spec
from .interpreter._import import util
    :type path: list or None
    :param path:
      optional list of path where the module or package should be
      searched (use sys.path if nothing or None is given)

    :type context_file: str or None
    :param context_file:
      context file to consider, necessary if the identifier has been
      introduced using a relative import unresolvable in the actual
      context (i.e. modutils)

    :raise ImportError: if there is no such module in the directory

    :rtype: (str or None, import type)
    :return:
      the path to the module's file or None if it's an integrated
      builtin module such as 'sys'
    """
    if context_file is not None:
        context = os.path.dirname(context_file)
    else:
        context = context_file
    if modpath[0] == 'xml':
        # handle _xmlplus
        try:
            return _spec_from_modpath(['_xmlplus'] + modpath[1:], path, context)
        except ImportError:
            return _spec_from_modpath(modpath, path, context)
    elif modpath == ['os', 'path']:
        # FIXME: currently ignoring search_path...

# Path: bin/deps/astroid/interpreter/_import/spec.py
#     _HAS_MACHINERY = True
#     _HAS_MACHINERY = False
# _SPEC_FINDERS = (
#     ImpFinder,
#     ZipFinder,
# )
# def _imp_type_to_module_type(imp_type):
#     def __new__(cls, name, module_type, location=None, origin=None,
#                 submodule_search_locations=None):
#     def __init__(self, path=None):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def contribute_to_path(self, spec, processed):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def contribute_to_path(self, spec, processed):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def contribute_to_path(self, spec, processed):
#     def __init__(self, path):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def find_module(self, modname, module_parts, processed, submodule_path):
#     def contribute_to_path(self, spec, processed):
# def _is_setuptools_namespace(location):
# def _cached_set_diff(left, right):
# def _precache_zipimporters(path=None):
# def _search_zip(modpath, pic):
# def _find_spec_with_path(search_path, modname, module_parts, processed, submodule_path):
# def find_spec(modpath, path=None):
# class ModuleSpec(_ModuleSpec):
# class Finder(object):
# class ImpFinder(Finder):
# class ExplicitNamespacePackageFinder(ImpFinder):
# class ZipFinder(Finder):
# class PathSpecFinder(Finder):


# Path: bin/deps/astroid/modutils.py
import imp
import os
import platform
import sys
import six
from distutils.sysconfig import get_python_lib # pylint: disable=import-error
from distutils.errors import DistutilsPlatformError
from .interpreter._import import spec
from .interpreter._import import util

    :type path: list or None
    :param path:
      optional list of path where the module or package should be
      searched (use sys.path if nothing or None is given)

    :type context_file: str or None
    :param context_file:
      context file to consider, necessary if the identifier has been
      introduced using a relative import unresolvable in the actual
      context (i.e. modutils)

    :raise ImportError: if there is no such module in the directory

    :rtype: (str or None, import type)
    :return:
      the path to the module's file or None if it's an integrated
      builtin module such as 'sys'
    """
    if context_file is not None:
        context = os.path.dirname(context_file)
    else:
        context = context_file
    if modpath[0] == 'xml':
        # handle _xmlplus
        try:
            return _spec_from_modpath(['_xmlplus'] + modpath[1:], path, context)
        except ImportError:
            return _spec_from_modpath(modpath, path, context)
    elif modpath == ['os', 'path']:
        # FIXME: currently ignoring search_path...

        return spec.ModuleSpec(name='os.path', location=os.path.__file__, module_type=imp.PY_SOURCE)