class_docstr: Class for textflint bar chart Report.
  Code from https://github.com/robustness-gym/robustness-gym
class_docstr_tok: ["Class","for","textflint","bar","chart","Report",".","Code","from","https",":","\/\/github.com\/robustness-gym\/robustness-gym"]
docstr: Rename categories, slices
  
  :param Dict[str, str] category_map: map from old to new category name
  :param Dict[str, str] slice_map: map from old to new slice name
docstr_tok: ["Rename","categories",",","slices",":","param","Dict","[","str",",","str","]","category_map",":","map","from","old","to","new","category","name",":","param","Dict","[","str",",","str","]","slice_map",":","map","from","old","to","new","slice","name"]
code: def rename(self, category_map, slice_map):
      r"""
      Rename categories, slices
  
      :param Dict[str, str] category_map: map from old to new category name
      :param Dict[str, str] slice_map: map from old to new slice name
  
      """
      if category_map is not None:
          self.data[0] = self.data[0].map(
              lambda x: category_map.get(x, x)
          )
      if slice_map is not None:
          self.data[1] = self.data[1].map(lambda x: slice_map.get(x, x))
  
imports: from __future__ import annotations
  import itertools
  from functools import partial
  from typing import Dict, List
  import dill
  import numpy
  import plotly.graph_objects
  from plotly.subplots import make_subplots
  import plotly.express
  from ..analyzer.analyzer import *
label_desc: Use image node_id 4 for calling the BarChart obj's underlying member method code with example usage: obj.rename(category_map, slice_map) without return types