def __init__(self, data, precision=None, table_styles=None, uuid=None, caption=None, table_attributes=None, cell_ids=True):
    self.ctx = defaultdict(list)
    self._todo = []
    if (not isinstance(data, (pd.Series, pd.DataFrame))):
        raise TypeError('``data`` must be a Series or DataFrame')
    if (data.ndim == 1):
        data = data.to_frame()
    if ((not data.index.is_unique) or (not data.columns.is_unique)):
        raise ValueError('style is not supported for non-unique indices.')
    self.data = data
    self.index = data.index
    self.columns = data.columns
    self.uuid = uuid
    self.table_styles = table_styles
    self.caption = caption
    if (precision is None):
        precision = get_option('display.precision')
    self.precision = precision
    self.table_attributes = table_attributes
    self.hidden_index = False
    self.hidden_columns = []
    self.cell_ids = cell_ids

    def default_display_func(x):
        if is_float(x):
            return '{:>.{precision}g}'.format(x, precision=self.precision)
        else:
            return x
    self._display_funcs = defaultdict((lambda : default_display_func))
def __init__(self, data, precision=None, table_styles=None, uuid=None, caption=None, table_attributes=None, cell_ids=True):
    self.ctx = defaultdict(list)
    self._todo = []
    if (not isinstance(data, (pd.Series, pd.DataFrame))):
        raise TypeError('``data`` must be a Series or DataFrame')
    if (data.ndim == 1):
        data = data.to_frame()
    if ((not data.index.is_unique) or (not data.columns.is_unique)):
        raise ValueError('style is not supported for non-unique indices.')
    self.data = data
    self.index = data.index
    self.columns = data.columns
    self.uuid = uuid
    self.table_styles = table_styles
    self.caption = caption
    if (precision is None):
        precision = get_option('display.precision')
    self.precision = precision
    self.table_attributes = table_attributes
    self.hidden_index = False
    self.hidden_columns = []
    self.cell_ids = cell_ids

    def default_display_func(x):
        if is_float(x):
            return '{:>.{precision}g}'.format(x, precision=self.precision)
        else:
            return x
    self._display_funcs = defaultdict((lambda : default_display_func))