nodes: 0, module; 1, function_definition; 2, function_name:in1d_sorted; 3, parameters; 4, block; 5, identifier:ar1; 6, identifier:ar2; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, comment:"""
      Does the same than np.in1d but uses the fact that ar1 and ar2 are sorted. Is therefore much faster.
  
      """; 13, boolean_operator; 14, comment:# check for empty arrays to avoid crash; 15, block; 16, assignment; 17, assignment; 18, comparison_operator:ar2[inds] == ar1; 19, comparison_operator:ar1.shape[0] == 0; 20, comparison_operator:ar2.shape[0] == 0; 21, return_statement; 22, identifier:inds; 23, call; 24, subscript; 25, integer:0; 26, subscript; 27, identifier:ar1; 28, subscript; 29, integer:0; 30, subscript; 31, integer:0; 32, list; 33, attribute; 34, argument_list; 35, identifier:inds; 36, comparison_operator:inds == len(ar2); 37, identifier:ar2; 38, identifier:inds; 39, attribute; 40, integer:0; 41, attribute; 42, integer:0; 43, identifier:ar2; 44, identifier:searchsorted; 45, identifier:ar1; 46, identifier:inds; 47, call; 48, identifier:ar1; 49, identifier:shape; 50, identifier:ar2; 51, identifier:shape; 52, identifier:len; 53, argument_list; 54, identifier:ar2
code: def in1d_sorted(ar1, ar2):
      """
      Does the same than np.in1d but uses the fact that ar1 and ar2 are sorted. Is therefore much faster.
  
      """
      if ar1.shape[0] == 0 or ar2.shape[0] == 0:  # check for empty arrays to avoid crash
          return []
      inds = ar2.searchsorted(ar1)
      inds[inds == len(ar2)] = 0
      return ar2[inds] == ar1