code: def build(self, parent):
      code = []
      if parent.classifier == "S":
          code.append(
              "s = df.fillna('Missing')['{col}']".format(
                  col=parent.selected_col
              )
          )
          s, cleaner_code = handle_cleaners(
              parent.data[parent.selected_col].fillna("Missing"),
              self.cleaners,
          )
          code += cleaner_code
      else:
          code.append(
              "s = df['{col}'].fillna('Missing').astype(str)".format(
                  col=parent.selected_col
              )
          )
          formatter = find_dtype_formatter(parent.dtype)
          s = parent.data[parent.selected_col].apply(
              lambda x: formatter(x, nan_display="Missing")
          )
  
      df_var = "base_vals" if len(self.split_cols) else "result"
  
      base_vals = build_hist(s, code, df_var)
      base_vals.index.name = parent.selected_col
      base_vals = base_vals.rename(
          columns={"data": "Frequency", "percent": "Percent"}
      )
      base_vals = base_vals[base_vals["Frequency"] > 0]
      base_vals = base_vals.reset_index().sort_values(
          ["Frequency", parent.selected_col], ascending=[False, True]
      )
      base_vals = base_vals.head(self.top)
  
      code += [
          "{}.index.name = '{}'".format(df_var, parent.selected_col),
          "{df_var} = {df_var}.{rename}".format(
              df_var=df_var,
              rename="rename(columns={'data': 'Frequency', 'percent': 'Percent'})",
          ),
          "{df_var} = {df_var}[{df_var}['Frequency'] > 0]".format(
              df_var=df_var
          ),
          "{df_var} = {df_var}.reset_index().sort_values(['Frequency', '{col}'], ascending=[False, True])".format(
              df_var=df_var, col=parent.selected_col
          ),
          "{df_var} = {df_var}.head(self.top)".format(df_var=df_var),
      ]
  
      if len(self.split_cols):
          top_vals = base_vals[parent.selected_col]
          val_filter = parent.data[parent.selected_col].isin(top_vals)
          val_filter_code = (
              "val_filter = df['{col}'].isin(top_vals)".format(
                  col=parent.selected_col
              )
          )
          if (top_vals == "Missing").any():
              val_filter = (
                  val_filter | parent.data[parent.selected_col].isnull()
              )
              val_filter_code = (
                  "({val_filter} | df['{col}'].isnull())".format(
                      val_filter=val_filter, col=parent.selected_col
                  )
              )
          hist = (
              parent.data[val_filter]
              .groupby([s] + self.split_cols)
              .size()
          )
          hist.name = "Frequency"
          hist = hist.reset_index()
          hist = hist[hist["Frequency"] > 0]
          outer_freq = hist.groupby(parent.selected_col)[
              "Frequency"
          ].transform("sum")
          hist["Percent"] = (hist["Frequency"] / outer_freq) * 100
  
          code += [
              "top_vals = {df_var}['{col}']".format(
                  df_var=df_var, col=parent.selected_col
              ),
              val_filter_code,
              "result = df[val_filter].groupby([s, '{}']).size()".format(
                  "', '".join(self.split_cols)
              ),
              "result.name = 'Frequency'",
              "result = result.reset_index()",
              "result = result[result['Frequency'] > 0]",
              "outer_freq = result.groupby('{}')['Frequency'].transform('sum')".format(
                  parent.selected_col
              ),
              "result['Percent'] = (result['Frequency'] / outer_freq) * 100",
          ]
      else:
          hist = base_vals
  
      col_types = grid_columns(hist)
      f = grid_formatter(col_types, nan_display=None)
      return_data = f.format_lists(hist)
      return_data = dict(data=return_data)
      return_data["top"] = self.top
      return return_data, 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 2 for calling the FrequencyAnalysis obj's underlying member method code with example usage: obj.build(parent) and returns: return_data,  code