parameters: (
          self,
          fs,
          path,
          mode="rb",
          block_size="default",
          autocommit=True,
          cache_type="readahead",
          cache_options=None,
          **kwargs
      )
docstring: Template for files with buffered reading and writing
  
          Parameters
          ----------
          fs: instance of FileSystem
          path: str
              location in file-system
          mode: str
              Normal file modes. Currently only 'wb', 'ab' or 'rb'. Some file
              systems may be read-only, and some may not support append.
          block_size: int
              Buffer size for reading or writing, 'default' for class default
          autocommit: bool
              Whether to write to final destination; may only impact what
              happens when file is being closed.
          cache_type: {"readahead", "none", "mmap", "bytes"}, default "readahead"
              Caching policy in read mode. See the definitions in ``core``.
          cache_options : dict
              Additional options passed to the constructor for the cache specified
              by `cache_type`.
          kwargs:
              Gets stored as self.kwargs
docstring_summary: Template for files with buffered reading and writing
docstring_tokens: Template for files with buffered reading and writing
function: def __init__(
          self,
          fs,
          path,
          mode="rb",
          block_size="default",
          autocommit=True,
          cache_type="readahead",
          cache_options=None,
          **kwargs
      ):
          """
          Template for files with buffered reading and writing
  
          Parameters
          ----------
          fs: instance of FileSystem
          path: str
              location in file-system
          mode: str
              Normal file modes. Currently only 'wb', 'ab' or 'rb'. Some file
              systems may be read-only, and some may not support append.
          block_size: int
              Buffer size for reading or writing, 'default' for class default
          autocommit: bool
              Whether to write to final destination; may only impact what
              happens when file is being closed.
          cache_type: {"readahead", "none", "mmap", "bytes"}, default "readahead"
              Caching policy in read mode. See the definitions in ``core``.
          cache_options : dict
              Additional options passed to the constructor for the cache specified
              by `cache_type`.
          kwargs:
              Gets stored as self.kwargs
          """
          from .core import caches
  
          self.path = path
          self.fs = fs
          self.mode = mode
          self.blocksize = (
              self.DEFAULT_BLOCK_SIZE if block_size in ["default", None] else block_size
          )
          self.loc = 0
          self.autocommit = autocommit
          self.end = None
          self.start = None
          self.closed = False
  
          if cache_options is None:
              cache_options = {}
  
          if "trim" in kwargs:
              warnings.warn(
                  "Passing 'trim' to control the cache behavior has been deprecated. "
                  "Specify it within the 'cache_options' argument instead.",
                  FutureWarning,
              )
              cache_options["trim"] = kwargs.pop("trim")
  
          self.kwargs = kwargs
  
          if mode not in {"ab", "rb", "wb"}:
              raise NotImplementedError("File mode not supported")
          if mode == "rb":
              if not hasattr(self, "details"):
                  self.details = fs.info(path)
              self.size = self.details["size"]
              self.cache = caches[cache_type](
                  self.blocksize, self._fetch_range, self.size, **cache_options
              )
          else:
              self.buffer = io.BytesIO()
              self.offset = None
              self.forced = False
              self.location = None
function_tokens: def __init__ ( self , fs , path , mode = "rb" , block_size = "default" , autocommit = True , cache_type = "readahead" , cache_options = None , * * kwargs ) : from . core import caches self . path = path self . fs = fs self . mode = mode self . blocksize = ( self . DEFAULT_BLOCK_SIZE if block_size in [ "default" , None ] else block_size ) self . loc = 0 self . autocommit = autocommit self . end = None self . start = None self . closed = False if cache_options is None : cache_options = { } if "trim" in kwargs : warnings . warn ( "Passing 'trim' to control the cache behavior has been deprecated. " "Specify it within the 'cache_options' argument instead." , FutureWarning , ) cache_options [ "trim" ] = kwargs . pop ( "trim" ) self . kwargs = kwargs if mode not in { "ab" , "rb" , "wb" } : raise NotImplementedError ( "File mode not supported" ) if mode == "rb" : if not hasattr ( self , "details" ) : self . details = fs . info ( path ) self . size = self . details [ "size" ] self . cache = caches [ cache_type ] ( self . blocksize , self . _fetch_range , self . size , * * cache_options ) else : self . buffer = io . BytesIO ( ) self . offset = None self . forced = False self . location = None