code: def dnld_ncbi_gene_file(fin, force_dnld=False, log=sys.stdout, loading_bar=True):
      
      if not os.path.exists(fin) or force_dnld:
          import gzip
          fin_dir, fin_base = os.path.split(fin)
          fin_gz = "{F}.gz".format(F=fin_base)
          fin_gz = os.path.join(fin_dir, fin_gz)
          if os.path.exists(fin_gz):
              os.remove(fin_gz)
          fin_ftp = "ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/{F}.gz".format(F=fin_base)
          ## if log is not None:
          ##     log.write("  DOWNLOADING GZIP: {GZ}\n".format(GZ=fin_ftp))
          ## if loading_bar:
          ##     loading_bar = wget.bar_adaptive
          ## wget.download(fin_ftp, bar=loading_bar)
          ## rsp = wget(fin_ftp)
          ftp_get(fin_ftp, fin_gz)
          with gzip.open(fin_gz, 'rb') as zstrm:
              if log is not None:
                  log.write("\n  READ GZIP:  {F}\n".format(F=fin_gz))
              with open(fin, 'wb') as ostrm:
                  ostrm.write(zstrm.read())
                  if log is not None:
                      log.write("  WROTE UNZIPPED: {F}\n".format(F=fin))
docs: Download a file from NCBI Gene's ftp server.