code: def build_df(dataset, is_merge=False):
      data = global_state.get_data(dataset["dataId"])
      cols = dataset.get("columns")
      cols = (
          list(set(cols + (dataset["index"] if is_merge else [])))
          if cols
          else None
      )
      if cols:
          data = data[cols]
      if is_merge and dataset["index"]:
          data = data.set_index(dataset["index"])
      return data
  
file_path: dtale/dtale/combine_data.py
imports: import json
  import pandas
  import dtale.global_state
label_desc: Use image node_id 1 for calling a global function with example usage: build_df(dataset, is_merge) and returns: data