<commit_before>#!/Vendors/anaconda/bin/python

import sys

## This class estimates the number of jelly beans in the world using input data
#  determined to be correlated to this result.
class NumJellyEstimator:

    ## Instantiating the class initializes some variables.
    def __init__(self):

        # The number of jelly beans in the world is correlated to the fraction
        # of land used for sugar and the world population.
        ## Fraction of land used for growing sugar
        self.fracLand4Sugar = 0.0
        ## World population
        self.worldPop = 0
        ## Scaling constant used in estimate
        self.scalingConst = 1e-1


    ## Set the fraction of land used for sugar.
    def set_land_frac_for_sugar(self, frac):

        # Make sure we've got a float.
        frac = float(frac) 

        # Check that the value is between zero and one.
        if ((frac <= 0.0) or (frac >= 1.0)):
            print "\nError: Fraction of land used for sugar must be between"\
                  +" 0 and 1.\n"
            sys.exit()

        # Store the fraction.
        self.fracLand4Sugar = frac


    ## Set the world population
    def set_world_pop(self, people):

        # Make sure we've got an int.
        people = int(people)

        # Check that the value is between zero and 1e20.
        if ((people <= 0) or (people >= 1e20)):
            print "\nError: World population must be between 0 and 1e20.\n"
            sys.exit()

        # Store the fraction.
        self.worldPop = people


    ## Return the scaling constant so the user can check it if they want.
    def get_scaling_const(self):

        return self.scalingConst


    ## Estimate the number of jelly beans in the world.
    def compute_Njelly_est(self):

        n = self.fracLand4Sugar * self.worldPop * self.scalingConst
        # If this value is zero, it means that some value didn't get set.
        if (n == 0.0):
            print "\nError: fraction of land for sugar and world population"\
                  +"must be set before computing estimate.\n"
        return int(n)

<commit_msg>added fraction of peole loving pink<commit_after>#!/Vendors/anaconda/bin/python

import sys

## This class estimates the number of jelly beans in the world using input data
#  determined to be correlated to this result.
class NumJellyEstimator:

    ## Instantiating the class initializes some variables.
    def __init__(self):

        # The number of jelly beans in the world is correlated to the fraction
        # of land used for sugar, the world population, and the fraction of 
        # people who like the color pink.
        ## Fraction of land used for growing sugar
        self.fracLand4Sugar = 0.0
        ## World population
        self.worldPop = 0
        ## Scaling constant used in estimate
        self.scalingConst = 1e-1
        ## Fraction of people who love the color pink.
        self.fracPplLovingPink = 0.0


    ## Set the fraction of land used for sugar.
    def set_land_frac_for_sugar(self, frac):

        # Make sure we've got a float.
        frac = float(frac) 

        # Check that the value is between zero and one.
        if ((frac <= 0.0) or (frac >= 1.0)):
            print "\nError: Fraction of land used for sugar must be between"\
                  +" 0 and 1.\n"
            sys.exit()

        # Store the fraction.
        self.fracLand4Sugar = frac


    ## Set the world population
    def set_world_pop(self, people):

        # Make sure we've got an int.
        people = int(people)

        # Check that the value is between zero and 1e20.
        if ((people <= 0) or (people >= 1e20)):
            print "\nError: World population must be between 0 and 1e20.\n"
            sys.exit()

        # Store the fraction.
        self.worldPop = people


    ## Set the fraction of people who love the color pink.
    def set_frac_ppl_loving_pink(self, frac):

        # Make sure we've got a float.
        frac = float(frac)

        # Check that the value is between zero and one.
        if ((frac <= 0.0) or (frac >= 1.0)):
            print "\nError: Fraction of people who love pink must be between"\
                  +" 0 and 1.\n"
            sys.exit()

        # Store the fraction.
        self.fracPplLovingPink = frac


    ## Return the scaling constant so the user can check it if they want.
    def get_scaling_const(self):

        return self.scalingConst


    ## Estimate the number of jelly beans in the world.
    def compute_Njelly_est(self):

        n = self.fracLand4Sugar * self.worldPop * self.scalingConst
        # If this value is zero, it means that some value didn't get set.
        if (n == 0.0):
            print "\nError: fraction of land for sugar and world population"\
                  +"must be set before computing estimate.\n"
        return int(n)


    ## Estimate the number of jelly beans in the world using the new pink data,
    def compute_Njelly_pink_est(self):

        n = self.fracLand4Sugar * self.worldPop * self.scalingConst / \
            (1.0 - self.fracPplLovingPink)
        # If this value is zero, it means that some value didn't get set.
        if (n == 0.0):
            print "\nError: fraction of land for sugar, world population, and"\
                  +"fraction of people loving pink must be set before "\
                  +"computing estimate.\n"
        return int(n)


{'fraction_non_alphanumeric': 0.07830433172898926, 'fraction_numerical': 0.012402813772676786, 'mean_word_length': 2.026890756302521, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1956832', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1455, 'n_words': 625}