code: def extract_gzip(
      gzip_path: Path, remove_finished: bool = False
  ) -> Path:
      print(f"Extracting {gzip_path}")
      if gzip_path.suffix != ".gz":
          raise RuntimeError("Not a gzipped file")
      fpath = gzip_path.with_suffix("")
  
      if fpath.exists():
          print(
              "Found a file that indicates that the input data "
              "has already been extracted, not doing it again."
          )
          print(f"This file is: {fpath}")
          return fpath
  
      with fpath.open("wb") as out_bf, gzip.GzipFile(
          gzip_path
      ) as zip_f:
          shutil.copyfileobj(zip_f, out_bf)
      if remove_finished:
          gzip_path.unlink()
  
      return fpath
  
file_path: PyTorch-BigGraph/torchbiggraph/converters/utils.py
imports: import gzip
  import shutil
  import tarfile
  from pathlib import Path
  from typing import Callable, Optional
  from urllib.parse import urlparse
  from urllib.request import urlretrieve
  from tqdm import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: extract_gzip(gzip_path, remove_finished) and returns: fpath, fpath