# Path: Cython/Utils.py
# def replace_suffix(path, newsuf):
# def open_new_file(path):
# def castrate_file(path, st):
# def file_newer_than(path, time):
# def path_exists(path):
# def decode_filename(filename):
# def detect_file_encoding(source_filename):
#   def __init__(self, stream):
#   def read(self, count=-1):
#   def readlines(self):
# def open_source_file(source_filename, mode="r",
#                      encoding=None, error_handling=None,
#                      require_normalised_newlines=True):
# def open_source_from_loader(loader,
#                             source_filename,
#                             encoding=None, error_handling=None,
#                             require_normalised_newlines=True):
# def str_to_number(value):
# def long_literal(value):
#     def all(items):
#     def any(items):
# class NormalisedNewlineStream(object):
# 
# Path: Cython/Compiler/Main.py
# class CompilationData(object):
# class Context(object):
# class CompilationSource(object):
# class CompilationOptions(object):
# class CompilationResult(object):
# class CompilationResultSet(dict):
#     def __init__(self, include_directories, compiler_directives, cpp=False,
#                  language_level=2, options=None, create_testscope=True):
#     def set_language_level(self, level):
#     def process_pxd(self, source_desc, scope, module_name):
#     def nonfatal_error(self, exc):
#     def find_module(self, module_name,
#             relative_to = None, pos = None, need_pxd = 1, check_module_name = True):
#     def find_pxd_file(self, qualified_name, pos):
#     def find_pyx_file(self, qualified_name, pos):
#     def find_include_file(self, filename, pos):
#     def search_include_directories(self, qualified_name, suffix, pos,
#                                    include=False, sys_path=False):
#     def find_root_package_dir(self, file_path):
#     def check_package_dir(self, dir, package_names):
#     def c_file_out_of_date(self, source_path):
#     def find_cimported_module_names(self, source_path):
#     def is_package_dir(self, dir_path):
#     def read_dependency_file(self, source_path):
#     def lookup_submodule(self, name):
#     def find_submodule(self, name):
#     def parse(self, source_desc, scope, pxd, full_module_name):
#     def extract_module_name(self, path, options):
#     def setup_errors(self, options, result):
#     def teardown_errors(self, err, options, result):
# def create_default_resultobj(compilation_source, options):
# def run_pipeline(source, options, full_module_name = None):
#     def __init__(self, source_desc, full_module_name, cwd):
#     def __init__(self, defaults = None, **kw):
#     def create_context(self):
#     def __init__(self):
#     def add(self, source, result):
# def compile_single(source, options, full_module_name = None):
# def compile_multiple(sources, options):
# def compile(source, options = None, full_module_name = None, **kwds):
# def setuptools_main():
# def main(command_line = 0):


from glob import glob
from distutils.extension import Extension
from Cython import Utils
from Cython.Compiler.Main import Context, CompilationOptions, default_options
    from Cython.Compiler.Main import compile, default_options
    from Cython.Compiler.Errors import CompileError, PyrexError
import re, os, sys
            import multiprocessing
            setattr(f, cache_name, cache)
        if args in cache:
            return cache[args]
        res = cache[args] = f(*args)
        return res
    return wrapper

def cached_method(f):
    cache_name = '__%s_cache' % f.__name__
    def wrapper(self, *args):
        cache = getattr(self, cache_name, None)
        if cache is None:
            cache = {}
            setattr(self, cache_name, cache)
        if args in cache:
            return cache[args]
        res = cache[args] = f(self, *args)
        return res
    return wrapper
    
def extended_iglob(pattern):
    if '**/' in pattern:
        seen = set()
        first, rest = pattern.split('**/', 1)
        if first == '':
            first = '.'
        for root in glob(first + "/"):
            for path in extended_iglob(os.path.join(root, rest)):
                if path not in seen:
                    seen.add(path)

# Path: Cython/Utils.py
# def replace_suffix(path, newsuf):
# def open_new_file(path):
# def castrate_file(path, st):
# def file_newer_than(path, time):
# def path_exists(path):
# def decode_filename(filename):
# def detect_file_encoding(source_filename):
#   def __init__(self, stream):
#   def read(self, count=-1):
#   def readlines(self):
# def open_source_file(source_filename, mode="r",
#                      encoding=None, error_handling=None,
#                      require_normalised_newlines=True):
# def open_source_from_loader(loader,
#                             source_filename,
#                             encoding=None, error_handling=None,
#                             require_normalised_newlines=True):
# def str_to_number(value):
# def long_literal(value):
#     def all(items):
#     def any(items):
# class NormalisedNewlineStream(object):
# 
# Path: Cython/Compiler/Main.py
# class CompilationData(object):
# class Context(object):
# class CompilationSource(object):
# class CompilationOptions(object):
# class CompilationResult(object):
# class CompilationResultSet(dict):
#     def __init__(self, include_directories, compiler_directives, cpp=False,
#                  language_level=2, options=None, create_testscope=True):
#     def set_language_level(self, level):
#     def process_pxd(self, source_desc, scope, module_name):
#     def nonfatal_error(self, exc):
#     def find_module(self, module_name,
#             relative_to = None, pos = None, need_pxd = 1, check_module_name = True):
#     def find_pxd_file(self, qualified_name, pos):
#     def find_pyx_file(self, qualified_name, pos):
#     def find_include_file(self, filename, pos):
#     def search_include_directories(self, qualified_name, suffix, pos,
#                                    include=False, sys_path=False):
#     def find_root_package_dir(self, file_path):
#     def check_package_dir(self, dir, package_names):
#     def c_file_out_of_date(self, source_path):
#     def find_cimported_module_names(self, source_path):
#     def is_package_dir(self, dir_path):
#     def read_dependency_file(self, source_path):
#     def lookup_submodule(self, name):
#     def find_submodule(self, name):
#     def parse(self, source_desc, scope, pxd, full_module_name):
#     def extract_module_name(self, path, options):
#     def setup_errors(self, options, result):
#     def teardown_errors(self, err, options, result):
# def create_default_resultobj(compilation_source, options):
# def run_pipeline(source, options, full_module_name = None):
#     def __init__(self, source_desc, full_module_name, cwd):
#     def __init__(self, defaults = None, **kw):
#     def create_context(self):
#     def __init__(self):
#     def add(self, source, result):
# def compile_single(source, options, full_module_name = None):
# def compile_multiple(sources, options):
# def compile(source, options = None, full_module_name = None, **kwds):
# def setuptools_main():
# def main(command_line = 0):


# Path: Cython/Build/Dependencies.py
from glob import glob
from distutils.extension import Extension
from Cython import Utils
from Cython.Compiler.Main import Context, CompilationOptions, default_options
    from Cython.Compiler.Main import compile, default_options
    from Cython.Compiler.Errors import CompileError, PyrexError
import re, os, sys
            import multiprocessing

            setattr(f, cache_name, cache)
        if args in cache:
            return cache[args]
        res = cache[args] = f(*args)
        return res
    return wrapper

def cached_method(f):
    cache_name = '__%s_cache' % f.__name__
    def wrapper(self, *args):
        cache = getattr(self, cache_name, None)
        if cache is None:
            cache = {}
            setattr(self, cache_name, cache)
        if args in cache:
            return cache[args]
        res = cache[args] = f(self, *args)
        return res
    return wrapper
    
def extended_iglob(pattern):
    if '**/' in pattern:
        seen = set()
        first, rest = pattern.split('**/', 1)
        if first == '':
            first = '.'
        for root in glob(first + "/"):
            for path in extended_iglob(os.path.join(root, rest)):
                if path not in seen:
                    seen.add(path)

                    yield path