def METHOD_NAME(fname):
  with open(fname, "r") as data:
    # skip data
    while 1:
      line = data.readline()
      if line[0].isnumeric() or line[0] == "#" or line[0] == "\n":
        break
    flags = np.array([
      "params", "capacity", "blocks", "options"
    ])
    for line in data:
      print(line[:-1])
      if flags[0] == "params":
        if line == "\n":
          continue
        if "problem" in line.lower():
          # found problem name
          name = re.search("Problem.*\n",line).group()[:-1]
          if name == "Problem 60-01":
            print("breakpoint")
          json_entry = {"name": name,
                        "n_cars": None,
                        "n_options": None,
                        "n_classes": None,
                        "n_cars_p_class": [],
                        "options": []}
          continue
        elif re.match("#(-)+", line):
          # comment line
          continue
        elif re.match("[0-9]+ [0-9]+ [0-9]+", line):
          # problem parameters
          n_cars, n_options, n_classes = map(int, line.strip("\n").split(" "))
          json_entry |= {"n_cars":n_cars, "n_options":n_options, "n_classes":n_classes}
          flags = np.roll(flags,-1)
          continue
        else:
          json_entry["note"] = line.strip("# \n")
      elif flags[0] == "capacity":
        if line.startswith("0"):
          flags = np.roll(flags,-2)
        else:
          json_entry["capacity"] = list(map(int,line.strip("\n").split(" ")))
          flags = np.roll(flags,-1)
          continue
      elif flags[0] == "blocks":
        json_entry["blocks"] = list(map(int,line.strip("\n").split(" ")))
        flags = np.roll(flags,-1)
        continue
      if flags[0] == "options":
        if len(line.strip(" \n")) == 0:
          # end of this problem, yield
          flags = np.roll(flags, -1)
          # convert options and cars_p_class to numpy
          yield json_entry
          json_entry = None
        else:
          c_idx, n, *opt = map(int, line.split(" "))
          json_entry["options"] += [opt]
          json_entry["n_cars_p_class"] += [n]
    if json_entry is not None:
      yield json_entry