# 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):


import os, sys, re, codecs
import Errors
import Version
import Options
        import Builtin, CythonScope
        import Pipeline
                import Parsing
    import Pipeline
from Scanning import PyrexScanner, FileSourceDescriptor
from Errors import PyrexError, CompileError, error, warning
from Symtab import ModuleScope
from Cython import Utils
            from Future import print_function, unicode_literals
        from CmdLine import parse_command_line
        dirs = self.include_directories
        if sys_path:
            dirs = dirs + sys.path
        if pos:
            file_desc = pos[0]
            if not isinstance(file_desc, FileSourceDescriptor):
                raise RuntimeError("Only file sources for code supported")
            if include:
                dirs = [os.path.dirname(file_desc.filename)] + dirs
            else:
                dirs = [self.find_root_package_dir(file_desc.filename)] + dirs

        dotted_filename = qualified_name
        if suffix:
            dotted_filename += suffix
        if not include:
            names = qualified_name.split('.')
            package_names = names[:-1]
            module_name = names[-1]
            module_filename = module_name + suffix
            package_filename = "__init__" + suffix

        for dir in dirs:
            path = os.path.join(dir, dotted_filename)
            if Utils.path_exists(path):
                return path
            if not include:
                package_dir = self.check_package_dir(dir, package_names)
                if package_dir is not None:
                    path = os.path.join(package_dir, module_filename)

# 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
import os, sys, re, codecs
import Errors
import Version
import Options
        import Builtin, CythonScope
        import Pipeline
                import Parsing
    import Pipeline
from Scanning import PyrexScanner, FileSourceDescriptor
from Errors import PyrexError, CompileError, error, warning
from Symtab import ModuleScope
from Cython import Utils
            from Future import print_function, unicode_literals
        from CmdLine import parse_command_line

        dirs = self.include_directories
        if sys_path:
            dirs = dirs + sys.path
        if pos:
            file_desc = pos[0]
            if not isinstance(file_desc, FileSourceDescriptor):
                raise RuntimeError("Only file sources for code supported")
            if include:
                dirs = [os.path.dirname(file_desc.filename)] + dirs
            else:
                dirs = [self.find_root_package_dir(file_desc.filename)] + dirs

        dotted_filename = qualified_name
        if suffix:
            dotted_filename += suffix
        if not include:
            names = qualified_name.split('.')
            package_names = names[:-1]
            module_name = names[-1]
            module_filename = module_name + suffix
            package_filename = "__init__" + suffix

        for dir in dirs:
            path = os.path.join(dir, dotted_filename)
            if Utils.path_exists(path):
                return path
            if not include:
                package_dir = self.check_package_dir(dir, package_names)
                if package_dir is not None:
                    path = os.path.join(package_dir, module_filename)

                    if Utils.path_exists(path):