code: def str_filt(self, str_, voc_type):
      alpha_dict = {
          "digit": string.digits,
          "lower": string.digits + string.ascii_lowercase,
          "upper": string.digits + string.ascii_letters,
          "all": string.digits
          + string.ascii_letters
          + string.punctuation,
      }
      if voc_type == "lower":
          str_ = str_.lower()
      for char in str_:
          if char not in alpha_dict[voc_type]:
              str_ = str_.replace(char, "")
      return str_
  
imports: import numpy
  import os
  from paddle.io import Dataset
  import lmdb
  import cv2
  import string
  import six
  import pickle
  from PIL import Image
  from .imaug import transform, create_operators
label_desc: Use image node_id 2 for calling the LMDBDataSetSR obj's underlying member method code with example usage: obj.str_filt(str_, voc_type) and returns: str_