def _cache_for_link(cache_dir, link):
 key_parts = [link.url_without_fragment]
 if ((link.hash_name is not None) and (link.hash is not None)):
  key_parts.append('='.join([link.hash_name, link.hash]))
 key_url = '#'.join(key_parts)
 hashed = hashlib.sha224(key_url.encode()).hexdigest()
 parts = [hashed[:2], hashed[2:4], hashed[4:6], hashed[6:]]
 return os.path.join(cache_dir, 'wheels', *parts)

def _cache_for_link ( cache_dir , link ) : key_parts = [ link . url_without_fragment ] if ( ( link . hash_name is not None ) and ( link . hash is not None ) ) : key_parts . append ( '=' . join ( [ link . hash_name , link . hash ] ) ) key_url = '#' . join ( key_parts ) hashed = hashlib . sha224 ( key_url . encode ( ) ) . hexdigest ( ) parts = [ hashed [ : 2 ] , hashed [ 2 : 4 ] , hashed [ 4 : 6 ] , hashed [ 6 : ] ] return os . path . join ( cache_dir , 'wheels' , * parts )
return a directory to store cached wheels in for link .