nodes: 0, module; 1, function_definition; 2, function_name:intersect; 3, parameters; 4, block; 5, identifier:self; 6, identifier:other; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""Intersect with `other` sorted index.
  
          Parameters
          ----------
          other : array_like, int
              Array of values to intersect with.
  
          Returns
          -------
          out : SortedIndex
              Values in common.
  
          Examples
          --------
  
          >>> import allel
          >>> idx1 = allel.SortedIndex([3, 6, 11, 20, 35])
          >>> idx2 = allel.SortedIndex([4, 6, 20, 39])
          >>> idx1.intersect(idx2)
          <SortedIndex shape=(2,) dtype=int64>
          [6, 20]
  
          """; 11, assignment; 12, call; 13, identifier:loc; 14, call; 15, attribute; 16, argument_list; 17, attribute; 18, argument_list; 19, identifier:self; 20, identifier:compress; 21, identifier:loc; 22, keyword_argument; 23, identifier:self; 24, identifier:locate_keys; 25, identifier:other; 26, keyword_argument; 27, identifier:axis; 28, integer:0; 29, identifier:strict; 30, False
code: def intersect(self, other):
          """Intersect with `other` sorted index.
  
          Parameters
          ----------
          other : array_like, int
              Array of values to intersect with.
  
          Returns
          -------
          out : SortedIndex
              Values in common.
  
          Examples
          --------
  
          >>> import allel
          >>> idx1 = allel.SortedIndex([3, 6, 11, 20, 35])
          >>> idx2 = allel.SortedIndex([4, 6, 20, 39])
          >>> idx1.intersect(idx2)
          <SortedIndex shape=(2,) dtype=int64>
          [6, 20]
  
          """
  
          loc = self.locate_keys(other, strict=False)
          return self.compress(loc, axis=0)