# Path: girlfriend/exception.py
# class InvalidTypeException(GirlFriendSysException):
# 
#     """当接受的参数对象类型不符合预期时抛出此异常
#     """
#     pass
# 
# Path: girlfriend/data/exception.py
# class IndexOutOfBoundsException(GirlFriendSysException):
#     """索引越界时抛出此异常
#     """
#     pass
# 
# class MissingKeyException(GirlFriendSysException):
#     """在key-value的结构中，当key所引用的数据不存在时抛出此异常
#     """
#     pass
# 
# class InvalidSizeException(GirlFriendSysException):
#     """当目标集合的尺寸不符合要求时抛出此异常
#     """
#     pass
# 
# Path: girlfriend/util/lang.py
# def singleton(clazz):
#     def constructor(*args, **kws):
#     def __new__(cls, name, bases, attrs):
#         def getter(self, method_name):
#             def method(*args, **kws):
#     def register_delegates(delegate_methods, attrs):
#             def make_method(method_name):
#                 def method(self, *args, **kws):
# def args2fields(private=True):
#     def _field_name(arg_name):
#     def _args2fields(constructor):
#         def _wrapped_constuctor(self, *args, **kws):
# def get_default_args(o):
# def parse_context_var(context, variable_name):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __getitem__(self, name):
#     def __setitem__(self, name, value):
#     def __init__(self, obj):
#     def __getattr__(self, attrname):
#     def __setattr__(self, attrname, value):
#     def __call__(self, *args, **kwds):
# class DelegateMeta(type):
#     class UnknownAttrError(GirlFriendSysException):
# class ObjDictModel(object):
# class SafeOperation(object):


import types
import prettytable
from abc import (
    ABCMeta,
    abstractproperty,
    abstractmethod
)
from girlfriend.exception import InvalidTypeException
from girlfriend.data.exception import (
    IndexOutOfBoundsException,
    MissingKeyException,
    InvalidSizeException
)
from girlfriend.util.lang import SequenceCollectionType

    @property
    def titles(self):
        return self._titles

    @property
    def row_num(self):
        return len(self._data)

    @property
    def column_num(self):
        return len(self._titles)

    def row(self, row_index):
        self._check_row_index(row_index)
        return self._row_type(self._data[row_index], self._mapping)

    def __getitem__(self, row_index):
        return self.row(row_index)

    def _check_row_index(self, row_index):
        if row_index >= self.row_num:
            raise IndexOutOfBoundsException(
                u"row_index={0}超出了边界，row_num={1}".format(
                    row_index,
                    self.row_num
                ))

    def _check_col_index(self, column_index):
        if column_index >= self.column_num:

# Path: girlfriend/exception.py
# class InvalidTypeException(GirlFriendSysException):
# 
#     """当接受的参数对象类型不符合预期时抛出此异常
#     """
#     pass
# 
# Path: girlfriend/data/exception.py
# class IndexOutOfBoundsException(GirlFriendSysException):
#     """索引越界时抛出此异常
#     """
#     pass
# 
# class MissingKeyException(GirlFriendSysException):
#     """在key-value的结构中，当key所引用的数据不存在时抛出此异常
#     """
#     pass
# 
# class InvalidSizeException(GirlFriendSysException):
#     """当目标集合的尺寸不符合要求时抛出此异常
#     """
#     pass
# 
# Path: girlfriend/util/lang.py
# def singleton(clazz):
#     def constructor(*args, **kws):
#     def __new__(cls, name, bases, attrs):
#         def getter(self, method_name):
#             def method(*args, **kws):
#     def register_delegates(delegate_methods, attrs):
#             def make_method(method_name):
#                 def method(self, *args, **kws):
# def args2fields(private=True):
#     def _field_name(arg_name):
#     def _args2fields(constructor):
#         def _wrapped_constuctor(self, *args, **kws):
# def get_default_args(o):
# def parse_context_var(context, variable_name):
#     def __getattr__(self, name):
#     def __setattr__(self, name, value):
#     def __getitem__(self, name):
#     def __setitem__(self, name, value):
#     def __init__(self, obj):
#     def __getattr__(self, attrname):
#     def __setattr__(self, attrname, value):
#     def __call__(self, *args, **kwds):
# class DelegateMeta(type):
#     class UnknownAttrError(GirlFriendSysException):
# class ObjDictModel(object):
# class SafeOperation(object):


# Path: girlfriend/data/table.py
import types
import prettytable
from abc import (
    ABCMeta,
    abstractproperty,
    abstractmethod
)
from girlfriend.exception import InvalidTypeException
from girlfriend.data.exception import (
    IndexOutOfBoundsException,
    MissingKeyException,
    InvalidSizeException
)
from girlfriend.util.lang import SequenceCollectionType


    @property
    def titles(self):
        return self._titles

    @property
    def row_num(self):
        return len(self._data)

    @property
    def column_num(self):
        return len(self._titles)

    def row(self, row_index):
        self._check_row_index(row_index)
        return self._row_type(self._data[row_index], self._mapping)

    def __getitem__(self, row_index):
        return self.row(row_index)

    def _check_row_index(self, row_index):
        if row_index >= self.row_num:
            raise IndexOutOfBoundsException(
                u"row_index={0}超出了边界，row_num={1}".format(
                    row_index,
                    self.row_num
                ))

    def _check_col_index(self, column_index):
        if column_index >= self.column_num:

            raise IndexOutOfBoundsException(