<s> def rename ( self , column_names = None , row_names = None ) : <EOL> """<STR_LIT>""" <EOL> from agate . table import Table <EOL> if isinstance ( column_names , dict ) : <EOL> column_names = [ column_names [ name ] if name in column_names else name for name in self . _column_names ] <EOL> if isinstance ( row_names , dict ) : <EOL> row_names = [ row_names [ name ] if name in row_names else name for name in self . _row_names ] <EOL> if column_names is not None and column_names != self . _column_names : <EOL> if row_names is None : <EOL> row_names = self . _row_names <EOL> return Table ( self . _rows , column_names , self . _column_types , row_names = row_names , _is_fork = False ) <EOL> else : <EOL> return self . _fork ( self . _rows , column_names , self . _column_types , row_names = row_names ) </s>
