code: def generate_checksums(directory, blacklist=_BLACKLIST):
      
      if not os.path.exists(directory):
          raise UserWarning("'%s' doesn't exists!" % directory)
  
      hashes = {}
      for root, dirs, files in os.walk(directory):
          for fn in sorted(files):
              # skip files on blacklist
              if fn in blacklist:
                  continue
  
              fn = os.path.join(root, fn)
  
              # compute hash of the file
              with open(fn) as f:
                  checksum = hashlib.md5(f.read())
  
              fn = _get_required_fn(fn, directory)
  
              hashes[fn] = checksum.hexdigest()
  
      return hashes
docs: Compute checksum for each file in `directory`, with exception of files
      specified in `blacklist`.
  
      Args:
          directory (str): Absolute or relative path to the directory.
          blacklist (list/set/tuple): List of blacklisted filenames. Only
                    filenames are checked, not paths!
  
      Returns:
          dict: Dict in format ``{fn: md5_hash}``.
  
      Note:
          File paths are returned as absolute paths from package root.
  
      Raises:
          UserWarning: When `directory` doesn't exists.