<commit_before>#!/usr/bin/python

import math

def ptdistr(particledatalist, ptypelist, deltapt, ypoint, deltay, dndptsums):
    for particle in particledatalist:
        if (particle.ptype in ptypelist):
            if (abs(particle.rap - ypoint) < deltay / 2.):
                ptbin = int(particle.pt / deltapt)
                try:
                    dndptsums[particle.ptype][ptbin] = (dndptsums[particle.ptype][ptbin]
                                                        + 1.0 / particle.pt)
                except IndexError:
                    continue

def etadistr(particles, deltaeta, etamin, dndetasum):
    np = 0
    for particle in particles:<commit_msg>pT spectra analysis: Use list of pT points<commit_after>#!/usr/bin/python

import math

def ptdistr(particledatalist, ptypelist, ptpoints, deltapt,
            ypoint, deltay, dndptsums):
    for particle in particledatalist:
        if (particle.ptype in ptypelist):
            if (abs(particle.rap - ypoint) < deltay / 2.):
                # Note that the default index value is beyond the list
                ptbin = len(ptpoints)
                for i in range(0, len(ptpoints)):
                    if (abs(particle.pt - ptpoints[i]) < deltapt / 2.0):
                        ptbin = i
                        break
                try:
                    dndptsums[particle.ptype][ptbin] = (dndptsums[particle.ptype][ptbin]
                                                        + 1.0 / particle.pt)
                except IndexError:
                    continue

def etadistr(particles, deltaeta, etamin, dndetasum):
    np = 0
    for particle in particles:
{'fraction_non_alphanumeric': 0.08880778588807786, 'fraction_numerical': 0.006690997566909975, 'mean_word_length': 1.5583203732503887, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5554363', 'n_tokens_mistral': 511, 'n_tokens_neox': 472, 'n_words': 119}