# 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
        return int(self._nrows())

    def __getattr__(self, name):
        """Get the tablecolumn object or keyword value.

        | A tablecolumn object is returned if it names a column.
        | The value of a keyword is returned if it names a keyword.
          If the keyword is a subtable, it opens the table and returns a
          table object.
        | The values of all keywords is returned if name equals _ or keys.

        An AttributeError is raised if the name is column nor keyword.

        For example::

          print t.DATA[i]           # print row i of column DATA
          print t.MS_VERSION        # print the MS version
          print t.keys              # print values of all keywords
          subtab = t.FEED           # open the FEED subtable

        """
        # First try if it is a column.
        try:
            return self.col(name)
        except Exception:
            pass
        # Now try if it is a keyword.
        try:
            val = self.getkeyword(name)
            # See if the keyword represents a subtable and try to open it.

# 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

        return int(self._nrows())

    def __getattr__(self, name):
        """Get the tablecolumn object or keyword value.

        | A tablecolumn object is returned if it names a column.
        | The value of a keyword is returned if it names a keyword.
          If the keyword is a subtable, it opens the table and returns a
          table object.
        | The values of all keywords is returned if name equals _ or keys.

        An AttributeError is raised if the name is column nor keyword.

        For example::

          print t.DATA[i]           # print row i of column DATA
          print t.MS_VERSION        # print the MS version
          print t.keys              # print values of all keywords
          subtab = t.FEED           # open the FEED subtable

        """
        # First try if it is a column.
        try:
            return self.col(name)
        except Exception:
            pass
        # Now try if it is a keyword.
        try:
            val = self.getkeyword(name)
            # See if the keyword represents a subtable and try to open it.

            if val != _do_remove_prefix(val):