code: def _parse(value, function, fmt):
      """
      Parse a string into a value, and format a nice ValueError if it fails.
  
      Returns `function(value)`.
      Any `ValueError` raised is catched and a new `ValueError` is raised
      with message `fmt.format(e)`, where `e` is the caught `ValueError`.
      """
      try:
          return function(value)
      except ValueError as e:
          raise_from(ValueError(fmt.format(e)), None)
  
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 1 for calling a global function with example usage: _parse(value, function, fmt) and returns: function