class_docstr: This class represents a SHA1 checksum based storage dir for state_dict
  and tensors.
  
  This means the same content will not be stored multiple times, resulting
  in space savings. (a.k.a. de-duplication)
  
  To make things easier for the callers, this class accept input data
  as files, state_dict or tensors. This class always returns in-memory
  data, not on-disk files. This class doesn't really care or know the actually
  data types.
  
  A key issue is dealing with content deletion. We use a reference counting
  algorithm, which means the caller must have symmetrical add/remove calls
  for each object.
  
  We used to support children-parent dependency graph and ref counting, but
  it is flawed since a grand-child can have the same SHA1 as the grand-parent,
  resulting in a cycle. This means caller must compute which parent is safe
  to delete in a version tracking graph. The lesson here is that content
  addressibility and dependency graphs do not mix well.
  
  We support multicore compression for the data to be store on per-object basis.
  We use pgzip to do parallel compression/decompression on top of it to use all
  the cores.
  
  Args:
      path (Path):
          The path in which a SHA1_Store will be created.
      init (bool, optional):
          - If ``True``, a new SHA1_Store in the path if not already exists.
          - Default: False
      sha1_buf_size (int):
          Buffer size used for checksumming. Default: 100MB.
      tmp_dir (str):
          Dir for temporary files if input is an in-memory object or output data needs
          to be decompressed first.
      pgzip_threads (int, optional):
          Number of threads (cores) used in compression. Default: None to use all cores.
      pgzip_block_size (int):
          Per-thread block size for compression. Default: 10MB.
class_docstr_tok: ["This","class","represents","a","SHA1","checksum","based","storage","dir","for","state_dict","and","tensors",".","This","means","the","same","content","will","not","be","stored","multiple","times",",","resulting","in","space","savings",".","(","a.k.a",".","de-duplication",")","To","make","things","easier","for","the","callers",",","this","class","accept","input","data","as","files",",","state_dict","or","tensors",".","This","class","always","returns","in-memory","data",",","not","on-disk","files",".","This","class","does","n't","really","care","or","know","the","actually","data","types",".","A","key","issue","is","dealing","with","content","deletion",".","We","use","a","reference","counting","algorithm",",","which","means","the","caller","must","have","symmetrical","add\/remove","calls","for","each","object",".","We","used","to","support","children-parent","dependency","graph","and","ref","counting",",","but","it","is","flawed","since","a","grand-child","can","have","the","same","SHA1","as","the","grand-parent",",","resulting","in","a","cycle",".","This","means","caller","must","compute","which","parent","is","safe","to","delete","in","a","version","tracking","graph",".","The","lesson","here","is","that","content","addressibility","and","dependency","graphs","do","not","mix","well",".","We","support","multicore","compression","for","the","data","to","be","store","on","per-object","basis",".","We","use","pgzip","to","do","parallel","compression\/decompression","on","top","of","it","to","use","all","the","cores",".","Args",":","path","(","Path",")",":","The","path","in","which","a","SHA1_Store","will","be","created",".","init","(","bool",",","optional",")",":","-","If","``","True","``",",","a","new","SHA1_Store","in","the","path","if","not","already","exists",".","-","Default",":","False","sha1_buf_size","(","int",")",":","Buffer","size","used","for","checksumming",".","Default",":","100MB",".","tmp_dir","(","str",")",":","Dir","for","temporary","files","if","input","is","an","in-memory","object","or","output","data","needs","to","be","decompressed","first",".","pgzip_threads","(","int",",","optional",")",":","Number","of","threads","(","cores",")","used","in","compression",".","Default",":","None","to","use","all","cores",".","pgzip_block_size","(","int",")",":","Per-thread","block","size","for","compression",".","Default",":","10MB","."]
docstr: Return original, deduped, gzipped sizes for an entry or the store.
docstr_tok: ["Return","original",",","deduped",",","gzipped","sizes","for","an","entry","or","the","store","."]
code: def size_info(
      self, sha1: Optional[str] = None
  ) -> Tuple[int, int, int]:
      """Return original, deduped, gzipped sizes for an entry or the store."""
      with self._readonly_json_ctx:
          if sha1:
              if sha1 not in self._json_dict.keys():
                  raise ValueError(f"SHA1 {sha1} not found")
              entry = self._json_dict[sha1]
              return (
                  entry[ENTRY_OS_KEY],
                  entry[ENTRY_DS_KEY],
                  entry[ENTRY_CS_KEY],
              )
          return (
              self._json_dict[STORE_OS_KEY],
              self._json_dict[STORE_DS_KEY],
              self._json_dict[STORE_CS_KEY],
          )
  
imports: import hashlib
  import json
  import logging
  import os
  from pathlib import Path
  import pickle
  import shutil
  import sys
  import tempfile
  import time
  from typing import Any, Dict, Optional, Tuple, Union, cast
  import pgzip
  import torch
  from torch import Tensor
  from fairscale.internal.containers import from_np, to_np
  from .utils import ExitCode
label_desc: Use image node_id 5 for calling the SHA1_Store obj's underlying member method code with example usage: obj.size_info(sha1) and returns: self,  self,  self, entry,  entry,  entry