class_docstr: Read contents of compressed file as a filesystem with one file inside.
docstr: The compressed file system can be instantiated from any compressed file.
  It reads the contents of compressed file as a filesystem with one file inside, as if it was an archive.
  
  The single file inside the filesystem is named after the compresssed file,
  without the compression extension at the end of the filename.
  
  Args:
      fo (:obj:``str``): Path to compressed file. Will fetch file using ``fsspec.open()``
      mode (:obj:``str``): Currently, only 'rb' accepted
      target_protocol(:obj:``str``, optional): To override the FS protocol inferred from a URL.
      target_options (:obj:``dict``, optional): Kwargs passed when instantiating the target FS.
docstr_tok: ["The","compressed","file","system","can","be","instantiated","from","any","compressed","file",".","It","reads","the","contents","of","compressed","file","as","a","filesystem","with","one","file","inside",",","as","if","it","was","an","archive",".","The","single","file","inside","the","filesystem","is","named","after","the","compresssed","file",",","without","the","compression","extension","at","the","end","of","the","filename",".","Args",":","fo","(",":","obj",":","``","str","``",")",":","Path","to","compressed","file",".","Will","fetch","file","using","``","fsspec.open","(",")","``","mode","(",":","obj",":","``","str","``",")",":","Currently",",","only","'rb","'","accepted","target_protocol","(",":","obj",":","``","str","``",",","optional",")",":","To","override","the","FS","protocol","inferred","from","a","URL",".","target_options","(",":","obj",":","``","dict","``",",","optional",")",":","Kwargs","passed","when","instantiating","the","target","FS","."]
code: def __init__(
      self,
      fo: str = "",
      target_protocol: Optional[str] = None,
      target_options: Optional[dict] = None,
      **kwargs,
  ):
      """
      The compressed file system can be instantiated from any compressed file.
      It reads the contents of compressed file as a filesystem with one file inside, as if it was an archive.
  
      The single file inside the filesystem is named after the compresssed file,
      without the compression extension at the end of the filename.
  
      Args:
          fo (:obj:``str``): Path to compressed file. Will fetch file using ``fsspec.open()``
          mode (:obj:``str``): Currently, only 'rb' accepted
          target_protocol(:obj:``str``, optional): To override the FS protocol inferred from a URL.
          target_options (:obj:``dict``, optional): Kwargs passed when instantiating the target FS.
      """
      super().__init__(self, **kwargs)
      # always open as "rb" since fsspec can then use the TextIOWrapper to make it work for "r" mode
      self.file = fsspec.open(
          fo,
          mode="rb",
          protocol=target_protocol,
          compression=self.compression,
          client_kwargs={
              "requote_redirect_url": False,  # see https://github.com/huggingface/datasets/pull/5459
              "trust_env": True,  # Enable reading proxy env variables.
              **(target_options or {}).pop(
                  "client_kwargs", {}
              ),  # To avoid issues if it was already passed.
          },
          **(target_options or {}),
      )
      self.compressed_name = os.path.basename(
          self.file.path.split("::")[0]
      )
      self.uncompressed_name = (
          self.compressed_name[: self.compressed_name.rindex(".")]
          if "." in self.compressed_name
          else self.compressed_name
      )
      self.dir_cache = None
  
imports: import os
  from typing import Optional
  import fsspec
  from fsspec.archive import AbstractArchiveFileSystem
  from fsspec.utils import DEFAULT_BLOCK_SIZE
label_desc: Use image node_id 1 to create a new BaseCompressedFileFileSystem object from inherited base classes: AbstractArchiveFileSystem with example: obj = BaseCompressedFileFileSystem(fo, target_protocol, target_options)