class_docstr: Fast overlap detection of a genomic position against a database of Ranges.
  
  Enables O(log n) computation of whether a point chr:pos falls within one of a
  large number of genomic ranges.
  
  This class does not supports overlapping or adjacent intervals. Any such
  intervals will be automatically merged together in the constructor.
  
  This class is immutable. No methods should be added that directly modify the
  ranges held by the class.
class_docstr_tok: ["Fast","overlap","detection","of","a","genomic","position","against","a","database","of","Ranges",".","Enables","O","(","log","n",")","computation","of","whether","a","point","chr",":","pos","falls","within","one","of","a","large","number","of","genomic","ranges",".","This","class","does","not","supports","overlapping","or","adjacent","intervals",".","Any","such","intervals","will","be","automatically","merged","together","in","the","constructor",".","This","class","is","immutable",".","No","methods","should","be","added","that","directly","modify","the","ranges","held","by","the","class","."]
docstr: Returns True iff some range in this RangeSet envelops the range.
  
  Args:
    chrom: str. The chromosome of interest.
    start: int. Zero-based inclusive index of the query range.
    end: int: Zero-based exclusive index of the query range.
  
  Returns:
    True if and only if some range in `self` completely spans the query
    range.
docstr_tok: ["Returns","True","iff","some","range","in","this","RangeSet","envelops","the","range",".","Args",":","chrom",":","str",".","The","chromosome","of","interest",".","start",":","int",".","Zero-based","inclusive","index","of","the","query","range",".","end",":","int",":","Zero-based","exclusive","index","of","the","query","range",".","Returns",":","True","if","and","only","if","some","range","in","`","self","`","completely","spans","the","query","range","."]
code: def envelops(self, chrom, start, end):
      """Returns True iff some range in this RangeSet envelops the range.
  
      Args:
        chrom: str. The chromosome of interest.
        start: int. Zero-based inclusive index of the query range.
        end: int: Zero-based exclusive index of the query range.
  
      Returns:
        True if and only if some range in `self` completely spans the query
        range.
      """
      chr_ranges = self._by_chr.get(chrom, None)
      if chr_ranges is None:
          return False
      # The intervaltree package does the inverse check, i.e. whether ranges
      # contained in it overlap with the query region. So it returns nothing
      # when start == end. We by convention want anything overlapping the start
      # position to still indicate enveloping in this case.
      if start == end:
          return chr_ranges.overlaps(start)
      else:
          overlap_set = chr_ranges.overlap(begin=start, end=end)
          return any(
              ov.begin <= start and ov.end >= end for ov in overlap_set
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import re
  from typing import Dict, Iterable, Optional, Sequence
  from absl import logging
  from etils import epath
  import intervaltree
  import six
  from third_party.nucleus.io import bed
  from third_party.nucleus.protos import position_pb2
  from third_party.nucleus.protos import range_pb2
  from third_party.nucleus.protos import reference_pb2
  from third_party.nucleus.protos import variants_pb2
label_desc: Use image node_id 13 for calling the RangeSet obj's underlying member method code with example usage: obj.envelops(chrom, start, end) and returns: False, chr_ranges, any