code: def _read_classes(csv_reader):
      """Parse the classes file given by csv_reader."""
      result = OrderedDict()
      for line, row in enumerate(csv_reader):
          line += 1
  
          try:
              class_name, class_id = row
          except ValueError:
              raise_from(
                  ValueError(
                      "line {}: format should be 'class_name,class_id'".format(
                          line
                      )
                  ),
                  None,
              )
          class_id = _parse(
              class_id,
              int,
              "line {}: malformed class ID: {{}}".format(line),
          )
  
          if class_name in result:
              raise ValueError(
                  "line {}: duplicate class name: '{}'".format(
                      line, class_name
                  )
              )
          result[class_name] = class_id
      return result
  
imports: from .generator import Generator
  from ..utils.image import read_image_bgr
  import numpy
  from PIL import Image
  from six import raise_from
  import csv
  import sys
  import os.path
  from collections import OrderedDict
label_desc: Use image node_id 2 for calling a global function with example usage: _read_classes(csv_reader) and returns: result