code: def get_gene_intervals(
      gene_symbols=None,
      gene_ids=None,
      transcript_ids=None,
      verbose=True,
      reference_genome=None,
      gtf_file=None,
  ):
      """Get intervals of genes or transcripts.
  
      Get the boundaries of genes or transcripts from a GTF file, for quick filtering of a Table or MatrixTable.
  
      On Google Cloud platform:
      Gencode v19 (GRCh37) GTF available at: gs://hail-common/references/gencode/gencode.v19.annotation.gtf.bgz
      Gencode v29 (GRCh38) GTF available at: gs://hail-common/references/gencode/gencode.v29.annotation.gtf.bgz
  
      Example
      -------
      >>> hl.filter_intervals(ht, get_gene_intervals(gene_symbols=['PCSK9'], reference_genome='GRCh37'))  # doctest: +SKIP
  
      Parameters
      ----------
  
      gene_symbols : :obj:`list` of :class:`str`, optional
         Gene symbols (e.g. PCSK9).
      gene_ids : :obj:`list` of :class:`str`, optional
         Gene IDs (e.g. ENSG00000223972).
      transcript_ids : :obj:`list` of :class:`str`, optional
         Transcript IDs (e.g. ENSG00000223972).
      verbose : :obj:`bool`
         If ``True``, print which genes and transcripts were matched in the GTF file.
      reference_genome : :class:`str` or :class:`.ReferenceGenome`, optional
         Reference genome to use (passed along to import_gtf).
      gtf_file : :class:`str`
         GTF file to load. If none is provided, but `reference_genome` is one of
         `GRCh37` or `GRCh38`, a default will be used (on Google Cloud Platform).
  
      Returns
      -------
      :obj:`list` of :class:`.Interval`
      """
      if (
          gene_symbols is None
          and gene_ids is None
          and transcript_ids is None
      ):
          raise ValueError(
              "get_gene_intervals requires at least one of gene_symbols, gene_ids, or transcript_ids"
          )
      ht = _load_gencode_gtf(gtf_file, reference_genome)
      criteria = []
      if gene_symbols:
          criteria.append(
              hl.any(
                  lambda y: (ht.feature == "gene")
                  & (ht.gene_name == y),
                  gene_symbols,
              )
          )
      if gene_ids:
          criteria.append(
              hl.any(
                  lambda y: (ht.feature == "gene")
                  & (ht.gene_id == y.split("\\.")[0]),
                  gene_ids,
              )
          )
      if transcript_ids:
          criteria.append(
              hl.any(
                  lambda y: (ht.feature == "transcript")
                  & (ht.transcript_id == y.split("\\.")[0]),
                  transcript_ids,
              )
          )
  
      ht = ht.filter(functools.reduce(operator.ior, criteria))
      gene_info = ht.aggregate(
          hl.agg.collect(
              (
                  ht.feature,
                  ht.gene_name,
                  ht.gene_id,
                  ht.transcript_id,
                  ht.interval,
              )
          )
      )
      if verbose:
          info(
              f"get_gene_intervals found {len(gene_info)} entries:\n"
              + "\n".join(
                  map(
                      lambda x: f'{x[0]}: {x[1]} ({x[2] if x[0] == "gene" else x[3]})',
                      gene_info,
                  )
              )
          )
      intervals = list(map(lambda x: x[-1], gene_info))
      return intervals
  
file_path: hail/hail/python/hail/experimental/import_gtf.py
imports: import operator
  import functools
  import hail
  from hail.genetics.reference_genome import reference_genome_type
  from hail.typecheck import typecheck, nullable, sequenceof
  from hail.utils.java import info
  from hail.utils import new_temp_file
label_desc: Use image node_id 2 for calling a global function with example usage: get_gene_intervals(gene_symbols, gene_ids, transcript_ids, verbose, reference_genome, gtf_file) and returns: intervals