# Path: supplement/tree.py
# class CtxNodeProvider(NodeProvider):
#     def __init__(self, ctx, node):
#         self.node = node
#         self.ctx = ctx
# 
#     def get_node(self):
#         return self.node
# 
# Path: supplement/common.py
# class Object(object):
#     def get_location(self):
#         raise NotImplementedError()
#         return None, None
# 
#     def get_names(self):
#         return set()
# 
#     def __contains__(self, name):
#         return name in self.get_names()
# 
#     def __getitem__(self, name):
#         return UnknownObject()
# 
#     def op_call(self, *args):
#         return UnknownObject()
# 
#     def op_getitem(self, idx):
#         return UnknownObject()
# 
#     def op_setitem(self, idx, value):
#         logging.getLogger(__name__).info('Try to set item on unknown object %s', self)
# 
#     def is_descriptor(self):
#         return False
# 
#     def get_assigned_attributes(self):
#         return {}
# 
#     def get_docstring(self):
#         return None
# 
#     def get_signature(self):
#         return None
# 
#     def get_scope(self):
#         return None
# 
#     def op_common_item(self):
#         return UnknownObject()
# 
# class GetObjectDelegate(object):
#     def get_names(self):
#         return self.get_object().get_names()
# 
#     def __getitem__(self, name):
#         return self.get_object()[name]
# 
#     def __contains__(self, name):
#         return name in self.get_object()
# 
#     def op_call(self, args):
#         return self.get_object().op_call(args)
# 
#     def op_getitem(self, idx):
#         return self.get_object().op_getitem(idx)
# 
#     def op_setitem(self, idx, value):
#         return self.get_object().op_setitem(idx, value)
# 
#     def get_location(self):
#         return self.get_object().get_location()
# 
#     def is_descriptor(self):
#         return self.get_object().is_descriptor()
# 
#     def get_assigned_attributes(self):
#         return self.get_object().get_assigned_attributes()
# 
#     def get_docstring(self):
#         return self.get_object().get_docstring()
# 
#     def get_signature(self):
#         return self.get_object().get_signature()
# 
#     def get_scope(self):
#         return self.get_object().get_scope()
# 
#     def op_common_item(self):
#         return self.get_object().op_common_item()
# 
# class MethodObject(GetObjectDelegate):
#     def __init__(self, obj, func_obj):
#         self.object = obj
#         self.function = func_obj
# 
#     def get_scope(self):
#         return self.function.get_scope()
# 
#     def get_object(self):
#         return self.function
# 
#     def op_call(self, args):
#         return self.function.op_call([self.object] + args)
# 
#     def get_signature(self):
#         sig = self.function.get_signature()
#         if sig:
#             name, args, vararg, kwarg, defaults = sig
#             return name, args[1:], vararg, kwarg, defaults
#         else:
#             return None
# 
# class UnknownObject(Object): pass


import logging
from types import FunctionType, ClassType, ModuleType, BuiltinFunctionType
from inspect import getargspec, getdoc
from .tree import CtxNodeProvider
from .common import Object, GetObjectDelegate, MethodObject, UnknownObject

        all_names.update(names)
        return all_names

    def __getitem__(self, name):
        try:
            return self._attrs[name]
        except KeyError:
            pass

        if name in self.get_names() and name in self._names:
            obj = self._attrs[name] = create_object(self, get_attr(self.obj, name),
                self.node_provider[name])
            return obj
        else:
            return wrap_in_method(self, self.get_class()[name])

    def op_getitem(self, idx):
        try:
            idx = idx.get_value()
        except AttributeError:
            pass
        else:
            try:
                value = self.obj[idx]
            except Exception, e:
                logging.getLogger(__name__).error(e)
            else:
                return create_object(self, value)


# Path: supplement/tree.py
# class CtxNodeProvider(NodeProvider):
#     def __init__(self, ctx, node):
#         self.node = node
#         self.ctx = ctx
# 
#     def get_node(self):
#         return self.node
# 
# Path: supplement/common.py
# class Object(object):
#     def get_location(self):
#         raise NotImplementedError()
#         return None, None
# 
#     def get_names(self):
#         return set()
# 
#     def __contains__(self, name):
#         return name in self.get_names()
# 
#     def __getitem__(self, name):
#         return UnknownObject()
# 
#     def op_call(self, *args):
#         return UnknownObject()
# 
#     def op_getitem(self, idx):
#         return UnknownObject()
# 
#     def op_setitem(self, idx, value):
#         logging.getLogger(__name__).info('Try to set item on unknown object %s', self)
# 
#     def is_descriptor(self):
#         return False
# 
#     def get_assigned_attributes(self):
#         return {}
# 
#     def get_docstring(self):
#         return None
# 
#     def get_signature(self):
#         return None
# 
#     def get_scope(self):
#         return None
# 
#     def op_common_item(self):
#         return UnknownObject()
# 
# class GetObjectDelegate(object):
#     def get_names(self):
#         return self.get_object().get_names()
# 
#     def __getitem__(self, name):
#         return self.get_object()[name]
# 
#     def __contains__(self, name):
#         return name in self.get_object()
# 
#     def op_call(self, args):
#         return self.get_object().op_call(args)
# 
#     def op_getitem(self, idx):
#         return self.get_object().op_getitem(idx)
# 
#     def op_setitem(self, idx, value):
#         return self.get_object().op_setitem(idx, value)
# 
#     def get_location(self):
#         return self.get_object().get_location()
# 
#     def is_descriptor(self):
#         return self.get_object().is_descriptor()
# 
#     def get_assigned_attributes(self):
#         return self.get_object().get_assigned_attributes()
# 
#     def get_docstring(self):
#         return self.get_object().get_docstring()
# 
#     def get_signature(self):
#         return self.get_object().get_signature()
# 
#     def get_scope(self):
#         return self.get_object().get_scope()
# 
#     def op_common_item(self):
#         return self.get_object().op_common_item()
# 
# class MethodObject(GetObjectDelegate):
#     def __init__(self, obj, func_obj):
#         self.object = obj
#         self.function = func_obj
# 
#     def get_scope(self):
#         return self.function.get_scope()
# 
#     def get_object(self):
#         return self.function
# 
#     def op_call(self, args):
#         return self.function.op_call([self.object] + args)
# 
#     def get_signature(self):
#         sig = self.function.get_signature()
#         if sig:
#             name, args, vararg, kwarg, defaults = sig
#             return name, args[1:], vararg, kwarg, defaults
#         else:
#             return None
# 
# class UnknownObject(Object): pass


# Path: supplement/objects.py
import logging
from types import FunctionType, ClassType, ModuleType, BuiltinFunctionType
from inspect import getargspec, getdoc
from .tree import CtxNodeProvider
from .common import Object, GetObjectDelegate, MethodObject, UnknownObject


        all_names.update(names)
        return all_names

    def __getitem__(self, name):
        try:
            return self._attrs[name]
        except KeyError:
            pass

        if name in self.get_names() and name in self._names:
            obj = self._attrs[name] = create_object(self, get_attr(self.obj, name),
                self.node_provider[name])
            return obj
        else:
            return wrap_in_method(self, self.get_class()[name])

    def op_getitem(self, idx):
        try:
            idx = idx.get_value()
        except AttributeError:
            pass
        else:
            try:
                value = self.obj[idx]
            except Exception, e:
                logging.getLogger(__name__).error(e)
            else:
                return create_object(self, value)


        return UnknownObject()