code: def _build_code(self, parent, top_code):
      pp = pprint.PrettyPrinter(indent=4)
      layout = pp.pformat(
          go.Layout(
              **{
                  "barmode": "group",
                  "legend": {"orientation": "h"},
                  "title": {
                      "text": "{}({}) Categorized by {}".format(
                          parent.selected_col,
                          self.category_agg,
                          self.category_col,
                      )
                  },
                  "xaxis": {"title": {"text": self.category_col}},
                  "yaxis": {
                      "title": {
                          "text": "{} ({})".format(
                              parent.selected_col, self.category_agg
                          )
                      },
                      "side": "left",
                  },
                  "yaxis2": {
                      "title": {"text": "Frequency"},
                      "side": "right",
                      "overlaying": "y",
                  },
              }
          )
      )
  
      code = [
          "chart = df{groupby}[['{col}']].agg(['{aggs}'])".format(
              groupby=pandas_util.groupby_code(
                  make_list(self.category_col), False
              ),
              col=parent.selected_col,
              aggs="', '".join(self.aggs),
          ),
          "chart.columns = chart.columns.droplevel(0)",
          'chart.columns = ["count", "data"]',
      ]
      if self.category_agg == "pctsum":
          code.append(
              "chart['data'] = chart['data'] / chart['data'].sum()"
          )
      code += [
          "chart.index.name = 'labels'",
          "chart = chart.reset_index()",
      ]
      code += top_code
      code += [
          "charts = [",
          "\tgo.Bar(x=chart['labels'].values, y=chart['data'].values),",
          "\tgo.Scatter(",
          "\t\tx=chart['labels'].values, y=chart['count'].values, yaxis='y2',",
          "\t\tname='Frequency', {}".format(LINE_CFG),
          "\t)",
          "]",
          "figure = go.Figure(data=charts, layout=go.{layout})".format(
              layout=layout
          ),
      ]
      return code
  
imports: import numpy
  import pandas
  import plotly.express
  import plotly.graph_objs
  import pprint
  import scipy.stats
  import time
  import dtale.global_state
  import dtale.pandas_util
  from dtale.code_export import build_code_export, build_final_chart_code
  from dtale.column_builders import clean, clean_code
  from dtale.describe import load_describe
  from dtale.query import build_query, load_filterable_data
  from dtale.utils import apply, classify_type, find_dtype, find_dtype_formatter, find_selected_column, get_bool_arg, get_int_arg, get_str_arg, grid_columns, grid_formatter, json_float, json_timestamp, make_list
label_desc: Use image node_id 3 for calling the CategoryAnalysis obj's underlying member method code with example usage: obj._build_code(parent, top_code) and returns: code