code: def calculate_even_genome_partitioning(
      reference_genome, interval_size
  ) -> List[hl.utils.Interval]:
      """create a list of locus intervals suitable for importing and merging gvcfs.
  
      Parameters
      ----------
      reference_genome: :class:`str` or :class:`.ReferenceGenome`,
          Reference genome to use. NOTE: only GRCh37 and GRCh38 references
          are supported.
      interval_size: :obj:`int` The ceiling and rough target of interval size.
          Intervals will never be larger than this, but may be smaller.
  
      Returns
      -------
      :obj:`List[Interval]`
      """
  
      def calc_parts(contig):
          def locus_interval(start, end):
              return hl.Interval(
                  start=hl.Locus(
                      contig=contig,
                      position=start,
                      reference_genome=reference_genome,
                  ),
                  end=hl.Locus(
                      contig=contig,
                      position=end,
                      reference_genome=reference_genome,
                  ),
                  includes_end=True,
              )
  
          contig_length = reference_genome.lengths[contig]
          n_parts = math.ceil(contig_length / interval_size)
          real_size = math.ceil(contig_length / n_parts)
          n = 1
          intervals = []
          while n < contig_length:
              start = n
              end = min(n + real_size, contig_length)
              intervals.append(locus_interval(start, end))
              n = end + 1
  
          return intervals
  
      if reference_genome.name == "GRCh37":
          contigs = [f"{i}" for i in range(1, 23)] + ["X", "Y", "MT"]
      elif reference_genome.name == "GRCh38":
          contigs = [f"chr{i}" for i in range(1, 23)] + [
              "chrX",
              "chrY",
              "chrM",
          ]
      else:
          raise ValueError(
              f"Unsupported reference genome '{reference_genome.name}', "
              "only 'GRCh37' and 'GRCh38' are supported"
          )
  
      intervals = []
      for ctg in contigs:
          intervals.extend(calc_parts(ctg))
      return intervals
  
imports: import math
  from typing import Collection, Optional, Set, Union, List, Tuple, Dict
  import hail
  from hail import MatrixTable, Table
  from hail.experimental.function import Function
  from hail.expr import StructExpression, unify_all, construct_expr
  from hail.expr.expressions import expr_bool, expr_str
  from hail.genetics.reference_genome import reference_genome_type
  from hail.ir import Apply, TableMapRows
  from hail.typecheck import oneof, sequenceof, typecheck
  from ..variant_dataset import VariantDataset
label_desc: Use image node_id 23 for calling a global function with example usage: calculate_even_genome_partitioning(reference_genome, interval_size) and returns: intervals, intervals, hl