code: def fast_simplify_label(labeling, c, blankIdx=0):
      # Adding BlankIDX after Non-Blank IDX
      if labeling and c == blankIdx and labeling[-1] != blankIdx:
          newLabeling = labeling + (c,)
  
      # Case when a nonBlankChar is added after BlankChar |len(char) - 1
      elif labeling and c != blankIdx and labeling[-1] == blankIdx:
          # If Blank between same character do nothing | As done by Simplify label
          if labeling[-2] == c:
              newLabeling = labeling + (c,)
  
          # if blank between different character, remove it | As done by Simplify Label
          else:
              newLabeling = labeling[:-1] + (c,)
  
      # if consecutive blanks : Keep the original label
      elif labeling and c == blankIdx and labeling[-1] == blankIdx:
          newLabeling = labeling
  
      # if empty beam & first index is blank
      elif not labeling and c == blankIdx:
          newLabeling = labeling
  
      # if empty beam & first index is non-blank
      elif not labeling and c != blankIdx:
          newLabeling = labeling + (c,)
  
      elif labeling and c != blankIdx:
          newLabeling = labeling + (c,)
  
      # Cases that might still require simplyfying
      else:
          newLabeling = labeling + (c,)
          newLabeling = simplify_label(newLabeling, blankIdx)
  
      return newLabeling
  
imports: from __future__ import print_function
  import torch
  import pickle
  import numpy
  import math
  import cv2
  from PIL import Image, JpegImagePlugin
  from scipy import ndimage
  import hashlib
  import sys, os
  from zipfile import ZipFile
  from .imgproc import loadImage
label_desc: Use image node_id 5 for calling a global function with example usage: fast_simplify_label(labeling, c, blankIdx) and returns: newLabeling