code: def test_annotate_intervals_bed2(self):
      ds = get_dataset()
      bed2 = hl.import_bed(
          resource("example2.bed"), reference_genome="GRCh37"
      )
      assert list(bed2.key.dtype) == ["interval"]
      assert list(bed2.row.dtype) == ["interval", "target"]
  
      interval_list2 = hl.import_locus_intervals(
          resource("exampleAnnotation2.interval_list")
      )
      assert list(interval_list2.key.dtype) == ["interval"]
      assert list(interval_list2.row.dtype) == ["interval", "target"]
  
      ann = ds.annotate_rows(target=bed2[ds.locus].target).rows()
      expr = (
          hl.case()
          .when(ann.locus.position <= 14000000, ann.target == "gene1")
          .when(ann.locus.position >= 17000000, ann.target == "gene2")
          .default(ann.target == hl.missing(hl.tstr))
      )
      assert ann.all(expr)
  
      intervallist = ds.annotate_rows(
          target=interval_list2[ds.locus].target
      ).rows()
      bed = ds.annotate_rows(target=bed2[ds.locus].target).rows()
      assert intervallist._same(bed)
  
imports: import unittest
  import hail
  from ..helpers import *
label_desc: Use image node_id 3 for calling the Tests obj's underlying member method code with example usage: obj.test_annotate_intervals_bed2() without return types