code: def build_code(self, data):
      replacements = []
      series = data[self.col]
      col_replacements = []
      for replacement in self.cfg or []:
          value = get_replacement_value_as_str(
              replacement, "value", series
          )
          replacement_type = replacement.get("type")
          if replacement_type == "agg":
              replace = "getattr(df['{col}'], '{agg}')()".format(
                  agg=replacement["value"], col=self.col
              )
          elif replacement_type == "col":
              col_replacements.append(
                  "s = np.where(s == {value}, data['{col2}'], s)".format(
                      col2=replacement["replace"], value=value
                  )
              )
          else:
              replace = get_replacement_value_as_str(
                  replacement, "replace", series
              )
          replacements.append(
              "\t{value}: {replace}".format(
                  value=value, replace=replace
              )
          )
  
      code = ["s = df['{col}']".format(col=self.col)]
      if len(replacements):
          replacements = ",\n".join(replacements)
          replacements = "{\n" + replacements + "}"
          code.append(
              "s = s.replace({replacements})".format(
                  replacements=replacements
              )
          )
      code += col_replacements
      code.append(
          "df.loc[:, '{name}'] = s".format(name=self.name or self.col)
      )
      return "\n".join(code)
  
imports: import re
  import numpy
  import pandas
  from six import string_types
  import dtale.global_state
  from dtale.column_builders import ReplaceColumnBuilder
  from dtale.utils import classify_type, find_dtype, dict_merge
label_desc: Use image node_id 3 for calling the ValueReplacement obj's underlying member method code with example usage: obj.build_code(data) and returns: str