code: def check_config(conf):
      '''Type and boundary check'''
      if 'fmode' in conf and not isinstance(conf['fmode'], string_types):
          raise TypeError(TAG + ": `fmode` must be a string")
  
      if 'dmode' in conf and not isinstance(conf['dmode'], string_types):
          raise TypeError(TAG + ": `dmode` must be a string")
  
      if 'depth' in conf:
          if not isinstance(conf['depth'], int):
              raise TypeError(TAG + ": `depth` must be an int")
          if conf['depth'] < 0:
              raise ValueError(TAG + ": `depth` must be a positive number")
  
      if 'hash_alg' in conf:
          if not isinstance(conf['hash_alg'], string_types):
              raise TypeError(TAG + ": `hash_alg` must be a string")
          if conf['hash_alg'] not in ACCEPTED_HASH_ALG:
              raise ValueError(TAG + ": `hash_alg` must be one of " + str(ACCEPTED_HASH_ALG)f check_config(conf):
      '''Type and boundary check'''
      if 'fmode' in conf and not isinstance(conf['fmode'], string_types):
          raise TypeError(TAG + ": `fmode` must be a string")
  
      if 'dmode' in conf and not isinstance(conf['dmode'], string_types):
          raise TypeError(TAG + ": `dmode` must be a string")
  
      if 'depth' in conf:
          if not isinstance(conf['depth'], int):
              raise TypeError(TAG + ": `depth` must be an int")
          if conf['depth'] < 0:
              raise ValueError(TAG + ": `depth` must be a positive number")
  
      if 'hash_alg' in conf:
          if not isinstance(conf['hash_alg'], string_types):
              raise TypeError(TAG + ": `hash_alg` must be a string")
          if conf['hash_alg'] not in ACCEPTED_HASH_ALG:
              raise ValueError(TAG + ": `hash_alg` must be one of " + str(ACCEPTED_HASH_ALG))
docs: Type and boundary check