code: def test_read_custom_reference_genome():
      # this test doesn't behave properly if these reference genomes are already defined in scope.
      available_rgs = set(hl.current_backend()._references.keys())
      assert "test_rg_0" not in available_rgs
      assert "test_rg_1" not in available_rgs
      assert "test_rg_2" not in available_rgs
  
      def assert_rg_loaded_correctly(name):
          rg = hl.get_reference(name)
          assert rg.contigs == ["1", "X", "Y", "MT"]
          assert rg.lengths == {"1": 5, "X": 4, "Y": 3, "MT": 2}
          assert rg.x_contigs == ["X"]
          assert rg.y_contigs == ["Y"]
          assert rg.mt_contigs == ["MT"]
          assert rg.par == [
              hl.Interval(
                  start=hl.Locus("X", 2, name),
                  end=hl.Locus("X", 4, name),
              )
          ]
  
      assert (
          hl.read_table(resource("custom_references.t")).count() == 14
      )
      assert_rg_loaded_correctly("test_rg_0")
      assert_rg_loaded_correctly("test_rg_1")
  
      # loading different reference genome with same name should fail
      # (different `test_rg_o` definition)
      with pytest.raises(FatalError):
          hl.read_matrix_table(
              resource("custom_references_2.t")
          ).count()
  
      assert (
          hl.read_matrix_table(
              resource("custom_references.mt")
          ).count_rows()
          == 14
      )
      assert_rg_loaded_correctly("test_rg_1")
      assert_rg_loaded_correctly("test_rg_2")
  
file_path: hail/hail/python/test/hail/genetics/test_reference_genome.py
imports: import pytest
  from random import randint
  import hail
  from hail.genetics import *
  from ..helpers import *
  from hail.utils import FatalError
label_desc: Use image node_id 5 for calling a global function with example usage: test_read_custom_reference_genome() without return types