code: def read_tier_from_lines(tier_lines):
      assert "class" in tier_lines[0], "error line 0, {}".format(
          tier_lines[0]
      )
      tier_class = (
          tier_lines[0]
          .split("=")[1]
          .replace(" ", "")
          .replace('"', "")
          .replace("\r", "")
          .replace("\n", "")
      )
  
      assert "name" in tier_lines[1], "error line 1, {}".format(
          tier_lines[1]
      )
      name = (
          tier_lines[1]
          .split("=")[1]
          .replace(" ", "")
          .replace('"', "")
          .replace("\r", "")
          .replace("\n", "")
      )
  
      assert "xmin" in tier_lines[2], "error line 2, {}".format(
          tier_lines[2]
      )
      xmin = float(
          tier_lines[2]
          .split("=")[1]
          .replace(" ", "")
          .replace("\r", "")
          .replace("\n", "")
      )
  
      assert "xmax" in tier_lines[3], "error line 3, {}".format(
          tier_lines[3]
      )
      xmax = float(
          tier_lines[3]
          .split("=")[1]
          .replace(" ", "")
          .replace("\r", "")
          .replace("\n", "")
      )
  
      assert (
          "intervals: size" in tier_lines[4]
      ), "error line 4, {}".format(tier_lines[4])
      intervals_num = int(
          tier_lines[4]
          .split("=")[1]
          .replace(" ", "")
          .replace("\r", "")
          .replace("\n", "")
      )
  
      assert len(tier_lines[5:]) == intervals_num * 5, "error lines"
  
      intervals = []
      for intervals_idx in range(intervals_num):
          assert tier_lines[
              5 + 5 * intervals_idx + 0
          ] == " " * 8 + "intervals [{}]:\r\n".format(intervals_idx + 1)
          assert tier_lines[
              5 + 5 * intervals_idx + 1
          ] == " " * 8 + "intervals [{}]:\r\n".format(intervals_idx + 1)
          intervals.append(
              read_interval_from_lines(
                  interval_lines=tier_lines[
                      7 + 5 * intervals_idx : 10 + 5 * intervals_idx
                  ]
              )
          )
      return Tier(
          tier_class=tier_class,
          name=name,
          xmin=xmin,
          xmax=xmax,
          intervals=intervals,
      )
  
imports: import argparse
  import codecs
  import glob
  import os
  import sys
  from multiprocessing import Pool
label_desc: Use image node_id 3 for calling a global function with example usage: read_tier_from_lines(tier_lines) and returns: Tier