code: def get_hgdp(output_dir, overwrite: bool = False):
      """Download subset of the `Human Genome Diversity Panel
      <https://www.internationalgenome.org/data-portal/data-collection/hgdp/>`__
      dataset and sample annotations.
  
      Notes
      -----
      The download is about 30MB.
  
      Parameters
      ----------
      output_dir
          Directory in which to write data.
      overwrite
          If ``True``, overwrite any existing files/directories at `output_dir`.
      """
      fs = Env.fs()
  
      if not _dir_exists(fs, output_dir):
          fs.mkdir(output_dir)
  
      matrix_table_path = os.path.join(output_dir, "HGDP.mt")
      vcf_path = os.path.join(output_dir, "HGDP.vcf.bgz")
      sample_annotations_path = os.path.join(
          output_dir, "HGDP_annotations.txt"
      )
      gene_annotations_path = os.path.join(
          output_dir, "ensembl_gene_annotations.txt"
      )
  
      if (
          overwrite
          or not _dir_exists(fs, matrix_table_path)
          or not _file_exists(fs, sample_annotations_path)
          or not _file_exists(fs, vcf_path)
          or not _file_exists(fs, gene_annotations_path)
      ):
          init_temp_dir()
          tmp_vcf = os.path.join(tmp_dir, "HGDP.vcf.bgz")
          source = resources["HGDP_matrix_table"]
          info(f"downloading HGDP VCF ...\n" f"  Source: {source}")
          sync_retry_transient_errors(
              urlretrieve, resources["HGDP_matrix_table"], tmp_vcf
          )
          cluster_readable_vcf = _copy_to_tmp(
              fs, local_path_uri(tmp_vcf), extension="vcf.bgz"
          )
          info("importing VCF and writing to matrix table...")
          hl.import_vcf(
              cluster_readable_vcf,
              min_partitions=16,
              reference_genome="GRCh38",
          ).write(matrix_table_path, overwrite=True)
  
          tmp_sample_annot = os.path.join(
              tmp_dir, "HGDP_annotations.txt"
          )
          source = resources["HGDP_annotations"]
          info(
              f"downloading HGDP annotations ...\n"
              f"  Source: {source}"
          )
          sync_retry_transient_errors(
              urlretrieve, source, tmp_sample_annot
          )
  
          tmp_gene_annot = os.path.join(
              tmp_dir, "ensembl_gene_annotations.txt"
          )
          source = resources["HGDP_ensembl_gene_annotations"]
          info(
              f"downloading Ensembl gene annotations ...\n"
              f"  Source: {source}"
          )
          sync_retry_transient_errors(
              urlretrieve, source, tmp_gene_annot
          )
  
          hl.hadoop_copy(
              local_path_uri(tmp_sample_annot), sample_annotations_path
          )
          hl.hadoop_copy(
              local_path_uri(tmp_gene_annot), gene_annotations_path
          )
          hl.hadoop_copy(local_path_uri(tmp_vcf), vcf_path)
          info("Done!")
      else:
          info("HGDP files found")
  
file_path: hail/hail/python/hail/utils/tutorial.py
imports: import hail
  from .java import Env, info
  from .misc import new_temp_file, local_path_uri, new_local_temp_dir
  import os
  import zipfile
  from urllib.request import urlretrieve
  from hailtop.utils import sync_retry_transient_errors
label_desc: Use image node_id 6 for calling a global function with example usage: get_hgdp(output_dir, overwrite) without return types