code: def test_reference_genome_sequence():
      gr3 = ReferenceGenome.read(resource("fake_ref_genome.json"))
      assert gr3.name == "my_reference_genome"
      assert not gr3.has_sequence()
  
      gr4 = ReferenceGenome.from_fasta_file(
          "test_rg",
          resource("fake_reference.fasta"),
          resource("fake_reference.fasta.fai"),
          mt_contigs=["b", "c"],
          x_contigs=["a"],
      )
      assert gr4.has_sequence()
      assert gr4._sequence_files == (
          resource("fake_reference.fasta"),
          resource("fake_reference.fasta.fai"),
      )
      assert gr4.x_contigs == ["a"]
  
      t = hl.import_table(
          resource("fake_reference.tsv"), impute=True, min_partitions=4
      )
      assert hl.eval(
          t.all(
              hl.get_sequence(t.contig, t.pos, reference_genome=gr4)
              == t.base
          )
      )
  
      l = hl.locus("a", 7, gr4)
      assert hl.eval(l.sequence_context(before=3, after=3) == "TTTCGAA")
  
      gr4.remove_sequence()
      assert not gr4.has_sequence()
  
      gr4.add_sequence(
          resource("fake_reference.fasta"),
          resource("fake_reference.fasta.fai"),
      )
      assert gr4.has_sequence()
      assert gr4._sequence_files == (
          resource("fake_reference.fasta"),
          resource("fake_reference.fasta.fai"),
      )
  
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 2 for calling a global function with example usage: test_reference_genome_sequence() without return types