code: def get_split_comma(input_str):
      input_str = input_str.replace(",", " , ")
      input_list = [item.strip() for item in input_str.split()]
      ref_char = "$"
      for index in range(len(input_list)):
          if input_list[index] == ",":
              if input_list[:index].count("(") == input_list[
                  :index
              ].count(")"):
                  if input_list[index + 1 :].count("(") == input_list[
                      index + 1 :
                  ].count(")"):
                      if input_list[index] == ref_char:
                          raise RuntimeError
                      else:
                          input_list[index] = ref_char
      new_str = " ".join(input_list).split("$")
      result_set = set()
      for str_ in new_str:
          result_set.add(str_.strip())
      return result_set
  
file_path: graph4nlp/examples/pytorch/semantic_parsing/graph2tree/jobs/src/evaluation.py
imports: from graph4nlp.pytorch.modules.evaluation.base import EvaluationMetricBase
label_desc: Use image node_id 2 for calling a global function with example usage: get_split_comma(input_str) and returns: result_set