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: Splits our intervals so that none are larger than max_size.
  
  Slices up the intervals in this RangeSet into a equivalent set of intervals
  (i.e., spanning the same set of bases), each of which is at most max_size in
  length.
  
  This function does not modify this RangeSet.
  
  Because RangeSet merges adjacent intervals, this function cannot use a
  RangeSet to represent the partitioned intervals and so instead generates
  these intervals via a yield statement.
  
  Args:
    max_size: int > 0. The maximum size of any interval.
  
  Yields:
    nucleus.genomics.v1.Range protos, in sorted order (see comment about order
    in __iter__).
  
  Raises:
    ValueError: if max_size <= 0.
docstr_tok: ["Splits","our","intervals","so","that","none","are","larger","than","max_size",".","Slices","up","the","intervals","in","this","RangeSet","into","a","equivalent","set","of","intervals","(","i.e.",",","spanning","the","same","set","of","bases",")",",","each","of","which","is","at","most","max_size","in","length",".","This","function","does","not","modify","this","RangeSet",".","Because","RangeSet","merges","adjacent","intervals",",","this","function","can","not","use","a","RangeSet","to","represent","the","partitioned","intervals","and","so","instead","generates","these","intervals","via","a","yield","statement",".","Args",":","max_size",":","int",">","0",".","The","maximum","size","of","any","interval",".","Yields",":","nucleus.genomics.v1.Range","protos",",","in","sorted","order","(","see","comment","about","order","in","__iter__",")",".","Raises",":","ValueError",":","if","max_size","<","=","0","."]
code: def partition(self, max_size):
      """Splits our intervals so that none are larger than max_size.
  
      Slices up the intervals in this RangeSet into a equivalent set of intervals
      (i.e., spanning the same set of bases), each of which is at most max_size in
      length.
  
      This function does not modify this RangeSet.
  
      Because RangeSet merges adjacent intervals, this function cannot use a
      RangeSet to represent the partitioned intervals and so instead generates
      these intervals via a yield statement.
  
      Args:
        max_size: int > 0. The maximum size of any interval.
  
      Yields:
        nucleus.genomics.v1.Range protos, in sorted order (see comment about order
        in __iter__).
  
      Raises:
        ValueError: if max_size <= 0.
      """
      if max_size <= 0:
          raise ValueError("max_size must be > 0: {}".format(max_size))
  
      for interval in self:
          refname = interval.reference_name
          for pos in range(interval.start, interval.end, max_size):
              yield make_range(
                  refname, pos, min(interval.end, pos + max_size)
              )
  
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 12 for calling the RangeSet obj's underlying member method code with example usage: obj.partition(max_size) without return types