#NEWLINE# def _get_cache( vcf_fn , array_type , region , cachedir , log ) : #NEWLINE# #INDENT# 'Utility function to obtain a cache file name and determine whether or\n    not a fresh cache file is available.' #NEWLINE# if isinstance ( vcf_fn , ( list , tuple ) ) : #NEWLINE# #INDENT# raise Exception ( 'caching only supported when loading from a single VCF file' ) #NEWLINE# #UNINDENT# cache_fn = _mk_cache_fn ( vcf_fn , array_type = array_type , region = region , cachedir = cachedir ) #NEWLINE# if ( not os . path . exists ( cache_fn ) ) : #NEWLINE# #INDENT# log ( 'no cache file found' ) #NEWLINE# is_cached = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( os . path . getmtime ( vcf_fn ) > os . path . getmtime ( cache_fn ) ) : #NEWLINE# #INDENT# is_cached = False #NEWLINE# log ( 'cache file out of date' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# is_cached = True #NEWLINE# log ( 'cache file available' ) #NEWLINE# #UNINDENT# #UNINDENT# return ( cache_fn , is_cached )