# Path: casacore/tables/tablehelper.py
# def _add_prefix(name):
#     """Add the prefix 'Table: ' to a table name to get a specific keyword value."""
#     return 'Table: ' + name
# 
# def _remove_prefix(name):
#     """Strip the possible prefix 'Table: ' from one or more table names."""
#     if isinstance(name, string_types):
#         return _do_remove_prefix(name)
#     return [_do_remove_prefix(nm) for nm in name]
# 
# def _do_remove_prefix(name):
#     """Strip the possible prefix 'Table: ' from a table name."""
#     res = name
#     if isinstance(res, string_types):
#         if res.find('Table: ') == 0:
#             res = res.replace('Table: ', '', 1)
#     return res
# 
# def _format_row(row, colnames, tab):
#     """
#     Helper function for _repr_html. Formats one row.
#     :param row: row of this table
#     :param colnames: vector of column names
#     :param tab: table, used to get the column keywords
#     :return: html-formatted row
#     """
#     out = ""
# 
#     out += "\n<tr>"
#     for colname in colnames:
#         out += "<td style='vertical-align:top; white-space:pre'>"
#         out += _format_cell(row[colname], tab.getcolkeywords(colname))
#         out += "</td>\n"
#     out += "</tr>\n"
#     return out


from six import string_types
from ._tables import (Table,
                      _default_ms,
                      _default_ms_subtable,
                      _required_ms_desc,
                      _complete_ms_desc)
from .tablehelper import (_add_prefix, _remove_prefix, _do_remove_prefix,
                          _format_row)
        from .tablerow import _tablerow
        from .tablecolumn import tablecolumn
        from .tablerow import tablerow
        from .tableiter import tableiter
        from .tableindex import tableindex
                    from casacore.tables import tabledelete
            from wxPython.wx import wxPySimpleApp
            from wxtablebrowser import CasaTestFrame
                        from casacore.tables import tabledelete
import six
        import casacore.util
            import casacore.tables.tableutil as pt
        import casacore.tables.tableutil as pt
        import os
                import wxPython
            import sys
        import os
    """

    def __init__(self, tablename, tabledesc=False, nrow=0, readonly=True,
                 lockoptions='default', ack=True, dminfo={}, endian='aipsrc',
                 memorytable=False, concatsubtables=[],
                 _columnnames=[], _datatypes=[],
                 _oper=0, _delete=False):
        """Open or create a table."""
        if _oper == 1:
            # This is the readascii constructor.
            tabname = _remove_prefix(tablename)
            Table.__init__(self, tabname, tabledesc, nrow, readonly,
                           lockoptions, ack, dminfo, endian, memorytable,
                           _columnnames, _datatypes)
        elif _oper == 2:
            # This is the query or calc constructor.
            Table.__init__(self, tablename, tabledesc)
            if len(self._getcalcresult()) != 0:
                # Do not make row object for a calc result
                return
        elif _oper == 3:
            # This is the constructor taking a Table (used by copy).
            Table.__init__(self, tablename)
        else:
            # This is the constructor for a normal table open.
            # It can be done in several forms:
            #  - open single existing table (PlainTable)
            #  - open multiple existing tables (ConcatTable)
            #  - create a new table (PlainTable or MemoryTable)
            #  - concatenate open tables (ConcatTable)

# Path: casacore/tables/tablehelper.py
# def _add_prefix(name):
#     """Add the prefix 'Table: ' to a table name to get a specific keyword value."""
#     return 'Table: ' + name
# 
# def _remove_prefix(name):
#     """Strip the possible prefix 'Table: ' from one or more table names."""
#     if isinstance(name, string_types):
#         return _do_remove_prefix(name)
#     return [_do_remove_prefix(nm) for nm in name]
# 
# def _do_remove_prefix(name):
#     """Strip the possible prefix 'Table: ' from a table name."""
#     res = name
#     if isinstance(res, string_types):
#         if res.find('Table: ') == 0:
#             res = res.replace('Table: ', '', 1)
#     return res
# 
# def _format_row(row, colnames, tab):
#     """
#     Helper function for _repr_html. Formats one row.
#     :param row: row of this table
#     :param colnames: vector of column names
#     :param tab: table, used to get the column keywords
#     :return: html-formatted row
#     """
#     out = ""
# 
#     out += "\n<tr>"
#     for colname in colnames:
#         out += "<td style='vertical-align:top; white-space:pre'>"
#         out += _format_cell(row[colname], tab.getcolkeywords(colname))
#         out += "</td>\n"
#     out += "</tr>\n"
#     return out


# Path: casacore/tables/table.py
from six import string_types
from ._tables import (Table,
                      _default_ms,
                      _default_ms_subtable,
                      _required_ms_desc,
                      _complete_ms_desc)
from .tablehelper import (_add_prefix, _remove_prefix, _do_remove_prefix,
                          _format_row)
        from .tablerow import _tablerow
        from .tablecolumn import tablecolumn
        from .tablerow import tablerow
        from .tableiter import tableiter
        from .tableindex import tableindex
                    from casacore.tables import tabledelete
            from wxPython.wx import wxPySimpleApp
            from wxtablebrowser import CasaTestFrame
                        from casacore.tables import tabledelete
import six
        import casacore.util
            import casacore.tables.tableutil as pt
        import casacore.tables.tableutil as pt
        import os
                import wxPython
            import sys
        import os

    """

    def __init__(self, tablename, tabledesc=False, nrow=0, readonly=True,
                 lockoptions='default', ack=True, dminfo={}, endian='aipsrc',
                 memorytable=False, concatsubtables=[],
                 _columnnames=[], _datatypes=[],
                 _oper=0, _delete=False):
        """Open or create a table."""
        if _oper == 1:
            # This is the readascii constructor.
            tabname = _remove_prefix(tablename)
            Table.__init__(self, tabname, tabledesc, nrow, readonly,
                           lockoptions, ack, dminfo, endian, memorytable,
                           _columnnames, _datatypes)
        elif _oper == 2:
            # This is the query or calc constructor.
            Table.__init__(self, tablename, tabledesc)
            if len(self._getcalcresult()) != 0:
                # Do not make row object for a calc result
                return
        elif _oper == 3:
            # This is the constructor taking a Table (used by copy).
            Table.__init__(self, tablename)
        else:
            # This is the constructor for a normal table open.
            # It can be done in several forms:
            #  - open single existing table (PlainTable)
            #  - open multiple existing tables (ConcatTable)
            #  - create a new table (PlainTable or MemoryTable)
            #  - concatenate open tables (ConcatTable)

            tabname = _remove_prefix(tablename)