code: def compute_percentages(
      group,
  ):
      # Set type_code as index and sort
      group = group.set_index("type_code").sort_index()
  
      # Compute percentage of value with question group
      perc = (group["value"] / group["value"].sum()) * 100
      group["percentage"] = perc
  
      # Compute percentage end, centered on "Neither agree nor disagree" (type_code 0)
      # Note that we access the perc series via index which is based on 'type_code'.
      group["percentage_end"] = perc.cumsum() - (
          perc[-2] + perc[-1] + perc[0] / 2
      )
  
      # Compute percentage start by subtracting percent
      group["percentage_start"] = group["percentage_end"] - perc
  
      return group
  
label_desc: Use image node_id 1 for calling a global function with example usage: compute_percentages(group) and returns: group