<s> """<STR_LIT>""" <EOL> import logging <EOL> import os <EOL> import shutil <EOL> from pip_accel . caches import AbstractCacheBackend <EOL> from pip_accel . utils import AtomicReplace , makedirs <EOL> logger = logging . getLogger ( __name__ ) <EOL> class LocalCacheBackend ( AbstractCacheBackend ) : <EOL> """<STR_LIT>""" <EOL> PRIORITY = <NUM_LIT:10> <EOL> def get ( self , filename ) : <EOL> """<STR_LIT>""" <EOL> pathname = os . path . join ( self . config . binary_cache , filename ) <EOL> if os . path . isfile ( pathname ) : <EOL> logger . debug ( "<STR_LIT>" , pathname ) <EOL> return pathname <EOL> else : <EOL> logger . debug ( "<STR_LIT>" , pathname ) <EOL> return None <EOL> def put ( self , filename , handle ) : <EOL> """<STR_LIT>""" <EOL> file_in_cache = os . path . join ( self . config . binary_cache , filename ) <EOL> logger . debug ( "<STR_LIT>" , file_in_cache ) <EOL> makedirs ( os . path . dirname ( file_in_cache ) ) <EOL> with AtomicReplace ( file_in_cache ) as temporary_file : <EOL> with open ( temporary_file , '<STR_LIT:wb>' ) as temporary_file_handle : <EOL> shutil . copyfileobj ( handle , temporary_file_handle ) <EOL> logger . debug ( "<STR_LIT>" ) </s>
