nodes: 0, module; 1, function_definition; 2, function_name:local_maxima; 3, parameters; 4, block; 5, identifier:vector; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, return_statement; 15, identifier:min_distance; 16, integer:4; 17, identifier:brd_mode; 18, string:"wrap"; 19, comment:"""
      Internal finder for local maxima .
      Returns UNSORTED indices of maxima in input vector.
      """; 20, assignment; 21, identifier:ii; 22, call; 23, block; 24, assignment; 25, assignment; 26, assignment; 27, call; 28, identifier:fits; 29, call; 30, identifier:range; 31, argument_list; 32, if_statement; 33, identifier:maxfits; 34, call; 35, identifier:maxima_mask; 36, comparison_operator:fits == maxfits; 37, identifier:maximum; 38, call; 39, attribute; 40, argument_list; 41, identifier:gaussian_filter; 42, argument_list; 43, call; 44, comparison_operator:fits[ii] == fits[ii-1]; 45, block; 46, identifier:maximum_filter; 47, argument_list; 48, identifier:fits; 49, identifier:maxfits; 50, attribute; 51, argument_list; 52, identifier:numpy; 53, identifier:asarray; 54, identifier:maximum; 55, call; 56, float:1.; 57, keyword_argument; 58, identifier:len; 59, argument_list; 60, subscript; 61, subscript; 62, expression_statement; 63, identifier:fits; 64, keyword_argument; 65, keyword_argument; 66, identifier:numpy; 67, identifier:transpose; 68, call; 69, attribute; 70, argument_list; 71, identifier:mode; 72, identifier:brd_mode; 73, identifier:fits; 74, identifier:fits; 75, identifier:ii; 76, identifier:fits; 77, binary_operator:ii-1; 78, assignment; 79, identifier:size; 80, identifier:min_distance; 81, identifier:mode; 82, identifier:brd_mode; 83, attribute; 84, argument_list; 85, identifier:numpy; 86, identifier:asarray; 87, identifier:vector; 88, keyword_argument; 89, identifier:ii; 90, integer:1; 91, subscript; 92, float:0.0; 93, identifier:maxima_mask; 94, identifier:nonzero; 95, identifier:dtype; 96, attribute; 97, identifier:fits; 98, binary_operator:ii-1; 99, identifier:numpy; 100, identifier:float32; 101, identifier:ii; 102, integer:1
code: def local_maxima(vector,min_distance = 4, brd_mode = "wrap"):
      """
      Internal finder for local maxima .
      Returns UNSORTED indices of maxima in input vector.
      """
      fits = gaussian_filter(numpy.asarray(vector,dtype=numpy.float32),1., mode=brd_mode)
      for ii in range(len(fits)):
          if fits[ii] == fits[ii-1]:
              fits[ii-1] = 0.0
      maxfits     = maximum_filter(fits, size=min_distance, mode=brd_mode)
      maxima_mask = fits == maxfits
      maximum     = numpy.transpose(maxima_mask.nonzero())
      return numpy.asarray(maximum)