def lazycache(filename, module_globals):
 if (filename in cache):
  if (len(cache[filename]) == 1):
   return True
  else:
   return False
 if ((not filename) or (filename.startswith('<') and filename.endswith('>'))):
  return False
 if (module_globals and ('__loader__' in module_globals)):
  name = module_globals.get('__name__')
  loader = module_globals['__loader__']
  get_source = getattr(loader, 'get_source', None)
  if (name and get_source):
   get_lines = functools.partial(get_source, name)
   cache[filename] = (get_lines,)
   return True
 return False

def lazycache ( filename , module_globals ) : if ( filename in cache ) : if ( len ( cache [ filename ] ) == 1 ) : return True else : return False if ( ( not filename ) or ( filename . startswith ( '<' ) and filename . endswith ( '>' ) ) ) : return False if ( module_globals and ( '__loader__' in module_globals ) ) : name = module_globals . get ( '__name__' ) loader = module_globals [ '__loader__' ] get_source = getattr ( loader , 'get_source' , None ) if ( name and get_source ) : get_lines = functools . partial ( get_source , name ) cache [ filename ] = ( get_lines , ) return True return False
seed the cache for filename with module_globals .