# 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
        If the keyword already exists, the type of the new value should match
        the existing one (e.g. a scalar cannot be replaced by an array).

        Similar to method :func:`getkeyword` a keyword name can be given
        consisting of multiple parts separated by dots. This represents nested
        structs, thus puts the value into a field in a struct (in a struct,
        etc.).
        If `makesubrecord=True` structs will be created for the keyword name
        parts that do not exist.

        Instead of a keyword name an index can be given which returns the value
        of the i-th keyword.

        """
        val = value
        if isinstance(val, table):
            val = _add_prefix(val.name())
        if isinstance(keyword, string_types):
            return self._putkeyword('', keyword, -1, makesubrecord, val)
        else:
            return self._putkeyword('', '', keyword, makesubrecord, val)

    def putcolkeyword(self, columnname, keyword, value, makesubrecord=False):
        """Put the value of a column keyword.

        It is similar to :func:`putkeyword`.

        """
        val = value
        if isinstance(val, table):

# 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

        If the keyword already exists, the type of the new value should match
        the existing one (e.g. a scalar cannot be replaced by an array).

        Similar to method :func:`getkeyword` a keyword name can be given
        consisting of multiple parts separated by dots. This represents nested
        structs, thus puts the value into a field in a struct (in a struct,
        etc.).
        If `makesubrecord=True` structs will be created for the keyword name
        parts that do not exist.

        Instead of a keyword name an index can be given which returns the value
        of the i-th keyword.

        """
        val = value
        if isinstance(val, table):
            val = _add_prefix(val.name())
        if isinstance(keyword, string_types):
            return self._putkeyword('', keyword, -1, makesubrecord, val)
        else:
            return self._putkeyword('', '', keyword, makesubrecord, val)

    def putcolkeyword(self, columnname, keyword, value, makesubrecord=False):
        """Put the value of a column keyword.

        It is similar to :func:`putkeyword`.

        """
        val = value
        if isinstance(val, table):

            val = _add_prefix(val.name())