nodes: 0, module; 1, function_definition; 2, function_name:intersect_ranges; 3, parameters; 4, block; 5, identifier:self; 6, identifier:starts; 7, identifier:stops; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, comment:"""Intersect with a set of ranges.
  
          Parameters
          ----------
          starts : array_like, int
              Range start values.
          stops : array_like, int
              Range stop values.
  
          Returns
          -------
          idx : SortedIndex
  
          Examples
          --------
  
          >>> import allel
          >>> import numpy as np
          >>> idx = allel.SortedIndex([3, 6, 11, 20, 35])
          >>> ranges = np.array([[0, 2], [6, 17], [12, 15], [31, 35],
          ...                    [100, 120]])
          >>> starts = ranges[:, 0]
          >>> stops = ranges[:, 1]
          >>> idx.intersect_ranges(starts, stops)
          <SortedIndex shape=(3,) dtype=int64>
          [6, 11, 35]
  
          """; 12, assignment; 13, call; 14, identifier:loc; 15, call; 16, attribute; 17, argument_list; 18, attribute; 19, argument_list; 20, identifier:self; 21, identifier:compress; 22, identifier:loc; 23, keyword_argument; 24, identifier:self; 25, identifier:locate_ranges; 26, identifier:starts; 27, identifier:stops; 28, keyword_argument; 29, identifier:axis; 30, integer:0; 31, identifier:strict; 32, False
code: def intersect_ranges(self, starts, stops):
          """Intersect with a set of ranges.
  
          Parameters
          ----------
          starts : array_like, int
              Range start values.
          stops : array_like, int
              Range stop values.
  
          Returns
          -------
          idx : SortedIndex
  
          Examples
          --------
  
          >>> import allel
          >>> import numpy as np
          >>> idx = allel.SortedIndex([3, 6, 11, 20, 35])
          >>> ranges = np.array([[0, 2], [6, 17], [12, 15], [31, 35],
          ...                    [100, 120]])
          >>> starts = ranges[:, 0]
          >>> stops = ranges[:, 1]
          >>> idx.intersect_ranges(starts, stops)
          <SortedIndex shape=(3,) dtype=int64>
          [6, 11, 35]
  
          """
  
          loc = self.locate_ranges(starts, stops, strict=False)
          return self.compress(loc, axis=0)