nodes: 0, module; 1, function_definition; 2, function_name:bin_spikes; 3, parameters; 4, block; 5, identifier:spike_times; 6, identifier:binsz; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Sort spike times into bins
  
      :param spike_times: times of spike instances
      :type spike_times: list
      :param binsz: length of time bin to use
      :type binsz: float
      :returns: list of bin indicies, one for each element in spike_times
      """; 12, assignment; 13, pattern_list; 14, call; 15, comment:# around to fix rounding errors; 16, block; 17, identifier:bins; 18, identifier:bins; 19, call; 20, identifier:i; 21, identifier:stime; 22, identifier:enumerate; 23, argument_list; 24, expression_statement; 25, attribute; 26, argument_list; 27, identifier:spike_times; 28, assignment; 29, identifier:np; 30, identifier:empty; 31, tuple; 32, keyword_argument; 33, subscript; 34, call; 35, call; 36, identifier:dtype; 37, identifier:int; 38, identifier:bins; 39, identifier:i; 40, attribute; 41, argument_list; 42, identifier:len; 43, argument_list; 44, identifier:np; 45, identifier:floor; 46, call; 47, identifier:spike_times; 48, attribute; 49, argument_list; 50, identifier:np; 51, identifier:around; 52, binary_operator:stime/binsz; 53, integer:5; 54, identifier:stime; 55, identifier:binsz
code: def bin_spikes(spike_times, binsz):
      """Sort spike times into bins
  
      :param spike_times: times of spike instances
      :type spike_times: list
      :param binsz: length of time bin to use
      :type binsz: float
      :returns: list of bin indicies, one for each element in spike_times
      """
      bins = np.empty((len(spike_times),), dtype=int)
      for i, stime in enumerate(spike_times):
          # around to fix rounding errors
          bins[i] = np.floor(np.around(stime/binsz, 5))
      return bins