code: def parse_entities(fieldOfStudy, entity2idx, cnt):
      res = [0] * cnt
      if fieldOfStudy:
          clips = fieldOfStudy.split(",")
          for clip in clips:
              tokens = clip.strip().split(":")
              field_id = tokens[0]
              field_idx = add2dict(field_id, entity2idx)
              start, end = int(tokens[1]), int(tokens[2])
              for i in range(start, end + 1):
                  res[i] = field_idx
      return res
  
imports: import codecs
  import pickle
  import time
  import os
  from datetime import datetime
  import random
  import numpy
  import math
  from multiprocessing import Process
  from utils.general import *
  from utils.data_helper import *
label_desc: Use image node_id 2 for calling a global function with example usage: parse_entities(fieldOfStudy, entity2idx, cnt) and returns: res