# 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 cython
import sys
import operator
import StringEncoding
import Naming
import Nodes
import PyrexTypes
import TypeSlots
import Builtin
import Symtab
import Options
            import MemoryView
                import Buffer
            import Buffer
                    import MemoryView
        import MemoryView
        import Buffer
                import Nodes
            import MemoryView
        import Buffer, MemoryView
        import Buffer, MemoryView
        import MemoryView
        import MemoryView
            import MemoryView
                import MemoryView
        import MemoryView
        import Buffer
from Errors import error, warning, warn_once, InternalError, CompileError
from Errors import hold_errors, release_errors, held_errors, report_error
from Code import UtilityCode, TempitaUtilityCode
from Nodes import Node
from PyrexTypes import py_object_type, c_long_type, typecast, error_type, \
     unspecified_type, cython_memoryview_ptr_type
from Builtin import list_type, tuple_type, set_type, dict_type, \
     unicode_type, str_type, bytes_type, type_type
from Cython import Utils
from Annotate import AnnotationItem
from Cython.Debugging import print_call_chain
from DebugFlags import debug_disposal_code, debug_temp_alloc, \
    debug_coercion
    from __builtin__ import basestring
        from TreeFragment import TreeFragment
            from NumpySupport import numpy_transform_attribute_node

    def analyse_base_and_index_types(self, env, getting = 0, setting = 0, analyse_base = True):
        # Note: This might be cleaned up by having IndexNode
        # parsed in a saner way and only construct the tuple if
        # needed.

        # Note that this function must leave IndexNode in a cloneable state.
        # For buffers, self.index is packed out on the initial analysis, and
        # when cloning self.indices is copied.
        self.is_buffer_access = False

        # a[...] = b
        self.is_memslice_copy = False
        # incomplete indexing, Ellipsis indexing or slicing
        self.memslice_slice = False
        # integer indexing
        self.memslice_index = False

        if analyse_base:
            self.base.analyse_types(env)

        if self.base.type.is_error:
            # Do not visit child tree if base is undeclared to avoid confusing
            # error messages
            self.type = PyrexTypes.error_type
            return

        is_slice = isinstance(self.index, SliceNode)

        # Potentially overflowing index value.

# 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/ExprNodes.py
import cython
import sys
import operator
import StringEncoding
import Naming
import Nodes
import PyrexTypes
import TypeSlots
import Builtin
import Symtab
import Options
            import MemoryView
                import Buffer
            import Buffer
                    import MemoryView
        import MemoryView
        import Buffer
                import Nodes
            import MemoryView
        import Buffer, MemoryView
        import Buffer, MemoryView
        import MemoryView
        import MemoryView
            import MemoryView
                import MemoryView
        import MemoryView
        import Buffer
from Errors import error, warning, warn_once, InternalError, CompileError
from Errors import hold_errors, release_errors, held_errors, report_error
from Code import UtilityCode, TempitaUtilityCode
from Nodes import Node
from PyrexTypes import py_object_type, c_long_type, typecast, error_type, \
     unspecified_type, cython_memoryview_ptr_type
from Builtin import list_type, tuple_type, set_type, dict_type, \
     unicode_type, str_type, bytes_type, type_type
from Cython import Utils
from Annotate import AnnotationItem
from Cython.Debugging import print_call_chain
from DebugFlags import debug_disposal_code, debug_temp_alloc, \
    debug_coercion
    from __builtin__ import basestring
        from TreeFragment import TreeFragment
            from NumpySupport import numpy_transform_attribute_node


    def analyse_base_and_index_types(self, env, getting = 0, setting = 0, analyse_base = True):
        # Note: This might be cleaned up by having IndexNode
        # parsed in a saner way and only construct the tuple if
        # needed.

        # Note that this function must leave IndexNode in a cloneable state.
        # For buffers, self.index is packed out on the initial analysis, and
        # when cloning self.indices is copied.
        self.is_buffer_access = False

        # a[...] = b
        self.is_memslice_copy = False
        # incomplete indexing, Ellipsis indexing or slicing
        self.memslice_slice = False
        # integer indexing
        self.memslice_index = False

        if analyse_base:
            self.base.analyse_types(env)

        if self.base.type.is_error:
            # Do not visit child tree if base is undeclared to avoid confusing
            # error messages
            self.type = PyrexTypes.error_type
            return

        is_slice = isinstance(self.index, SliceNode)

        # Potentially overflowing index value.

        if not is_slice and isinstance(self.index, IntNode) and Utils.long_literal(self.index.value):