code: def parse_vcf(vcf_path: str) -> Set[str]:
      """Parse VCF to extract a dict keyed by locus IDs.
  
      Args:
          vcf_path: string, a path to a VCF file, that is gzipped (.gz) or not.
  
      Returns:
          All locus IDs from the VCF, where each locus ID has form "chr:start_end".
      """
      # Read gzipped file or uncompressed file.
      if vcf_path.endswith(".gz"):
          vcf_reader = gzip.open(vcf_path)
      else:
          vcf_reader = open(vcf_path, "r")
  
      # This is not using nucleus.io.vcf VcfReader because it needs to support
      # pieces of vcf files without headers.
      ids_from_vcf = set()
      for l in vcf_reader:
          if isinstance(l, bytes):
              l = l.decode("utf-8")
          if not l.startswith("#"):
              cols = l.strip().split()
              if len(cols) < 4:
                  continue
              # VCF uses 1-based positions while Nucleus' variant proto is 0-based.
              # Subtracting 1 here converts the VCF positions to 0-based coordinates.
              pos = int(cols[1]) - 1
              # Format: chrom:start_refBases, e.g. X:100_A.
              locus_id = "{}:{}_{}".format(cols[0], pos, cols[3])
              ids_from_vcf.add(locus_id)
      vcf_reader.close()
      return ids_from_vcf
  
imports: import gzip
  import json
  import os
  from typing import Any, Callable, Dict, Optional, Sequence, Set
  from absl import app
  from absl import flags
  from absl import logging
  import pandas
  import tensorflow
  from deepvariant.protos import deepvariant_pb2
  from third_party.nucleus.io import sharded_file_utils
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.protos import variants_pb2
  from third_party.nucleus.util import errors
  from third_party.nucleus.util import ranges
  from third_party.nucleus.util import vis
label_desc: Use image node_id 1 for calling a global function with example usage: parse_vcf(vcf_path) and returns: ids_from_vcf