<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_from_directory_by_hashes(cache_type, hashes):
 """ Deletes all cache files corresponding to a list of hashes from a directory :param str directory: The type of cache to delete files for. :param list(str) hashes: The hashes to delete the files for """

    global CACHE_
    if hashes == '*':
        CACHE_[cache_type] = {}
    for h in hashes:
        if h in CACHE_[cache_type]:
            del CACHE_[cache_type][h]
    write_out()