parameters: (filename, mode='rb')
return_statement: return kb.cache.content[filename]
docstring: Cached reading of file content (avoiding multiple same file reading)
docstring_summary: Cached reading of file content (avoiding multiple same file reading)
docstring_tokens: Cached reading of file content ( avoiding multiple same file reading )
function: def readCachedFileContent(filename, mode='rb'):
      """
      Cached reading of file content (avoiding multiple same file reading)
      """
  
      if filename not in kb.cache.content:
          with kb.locks.cache:
              if filename not in kb.cache.content:
                  checkFile(filename)
                  with openFile(filename, mode) as f:
                      kb.cache.content[filename] = f.read()
  
      return kb.cache.content[filename]
function_tokens: def readCachedFileContent ( filename , mode = 'rb' ) : if filename not in kb . cache . content : with kb . locks . cache : if filename not in kb . cache . content : checkFile ( filename ) with openFile ( filename , mode ) as f : kb . cache . content [ filename ] = f . read ( ) return kb . cache . content [ filename ]