class_docstr: To implement your own bytecode cache you have to subclass this class
  and override :meth:`load_bytecode` and :meth:`dump_bytecode`.  Both of
  these methods are passed a :class:`~jinja2.bccache.Bucket`.
  
  A very basic bytecode cache that saves the bytecode on the file system::
  
      from os import path
  
      class MyCache(BytecodeCache):
  
          def __init__(self, directory):
              self.directory = directory
  
          def load_bytecode(self, bucket):
              filename = path.join(self.directory, bucket.key)
              if path.exists(filename):
                  with open(filename, 'rb') as f:
                      bucket.load_bytecode(f)
  
          def dump_bytecode(self, bucket):
              filename = path.join(self.directory, bucket.key)
              with open(filename, 'wb') as f:
                  bucket.write_bytecode(f)
  
  A more advanced version of a filesystem based bytecode cache is part of
  Jinja.
class_docstr_tok: ["To","implement","your","own","bytecode","cache","you","have","to","subclass","this","class","and","override",":","meth",":","`","load_bytecode","`","and",":","meth",":","`","dump_bytecode","`",".","Both","of","these","methods","are","passed","a",":","class",":","`","~jinja2.bccache.Bucket","`",".","A","very","basic","bytecode","cache","that","saves","the","bytecode","on","the","file","system",":",":","from","os","import","path","class","MyCache","(","BytecodeCache",")",":","def","__init__","(","self",",","directory",")",":","self.directory","=","directory","def","load_bytecode","(","self",",","bucket",")",":","filename","=","path.join","(","self.directory",",","bucket.key",")","if","path.exists","(","filename",")",":","with","open","(","filename",",","'rb","'",")","as","f",":","bucket.load_bytecode","(","f",")","def","dump_bytecode","(","self",",","bucket",")",":","filename","=","path.join","(","self.directory",",","bucket.key",")","with","open","(","filename",",","'wb","'",")","as","f",":","bucket.write_bytecode","(","f",")","A","more","advanced","version","of","a","filesystem","based","bytecode","cache","is","part","of","Jinja","."]
docstr: Subclasses have to override this method to write the bytecode
  from a bucket back to the cache.  If it unable to do so it must not
  fail silently but raise an exception.
docstr_tok: ["Subclasses","have","to","override","this","method","to","write","the","bytecode","from","a","bucket","back","to","the","cache",".","If","it","unable","to","do","so","it","must","not","fail","silently","but","raise","an","exception","."]
code: def dump_bytecode(self, bucket: Bucket) -> None:
      """Subclasses have to override this method to write the bytecode
      from a bucket back to the cache.  If it unable to do so it must not
      fail silently but raise an exception.
      """
      raise NotImplementedError()
  
imports: import errno
  import fnmatch
  import marshal
  import os
  import pickle
  import stat
  import sys
  import tempfile
  import typing
  from hashlib import sha1
  from io import BytesIO
  from types import CodeType
label_desc: Use image node_id 2 for calling the BytecodeCache obj's underlying member method code with example usage: obj.dump_bytecode(bucket) without return types