<commit_before>from __future__ import unicode_literals, print_function
""" This module converted from WHO Anthro AnthroComputation.cs -- original C# code is behind #C# comments

General Note: For some reason completely foreign to me [Vernon], WHO performed all of these calculations in Decimal.
  Were they worried about loosing pennies?  Did they imagine that double precision real was not good enough?
  Who can guess?  I will perform all of the calculations in float.
"""

import sys
import math



class AnthropometricResult(object):
    pass  # fields will be dynamically assigned in Python

NaN = float('NaN')  # the floating point value "Not A Number"
<commit_msg>first translation of anthrocomputation additions from js, part 2<commit_after>from __future__ import unicode_literals, print_function
""" This module converted from WHO Anthro AnthroComputation.cs -- original C# code is behind #C# comments

General Note: For some reason completely foreign to me [Vernon], WHO performed all of these calculations in Decimal.
  Were they worried about loosing pennies?  Did they imagine that double precision real was not good enough?
  Who can guess?  I will perform all of the calculations in float.
"""

import sys
import math

def roundFloat(number, decimalPlaces):
    if not decimalPlaces:
        decimalPlaces = 2
    elif decimalPlaces < 0:
        decimalPlaces = 0
    else
        decimalPlaces = int(decimalPlaces)
    p = math.pow(10, decimalPlaces)
    return round(number * p) / p
}


# Lists all the 'logical' indicators, i.e. considering W4L and W4H to
# be one indicator.
Indicator = {
    'Weight4LengthOrHeight': 0,
    'Weight4Age': 1,
    'LengthOrHeight4Age': 2,
    'BMI4Age': 3,
    'HC4Age': 4,
    'MUAC4Age': 5,
    'TSF4Age': 6,
    'SSF4Age': 7
}

# Lists all the 'physical' indicators, i.e. separately considering W4L and W4H.
GraphIndicator = {
    'Weight4Height': -1,
    'Weight4Length': Indicator.Weight4LengthOrHeight,
    'Weight4Age': Indicator.Weight4Age,
    'LengthOrHeight4Age': Indicator.LengthOrHeight4Age,
    'BMI4Age': Indicator.BMI4Age,
    'HC4Age': Indicator.HC4Age,
    'MUAC4Age': Indicator.MUAC4Age,
    'TSF4Age': Indicator.TSF4Age,
    'SSF4Age': Indicator.SSF4Age
}

# The different anthro z-score flags.
Flag = {
    'Flag_None': 0,
    'W4LHZ': 1,
    'LH4AZ': 2,
    'W4AZ': 3,
    'W4LHZ_LH4AZ': 4,
    'W4LHZ_W4AZ': 5,
    'LH4AZ_W4AZ': 6,
    'W4LHZ_LH4AZ_W4AZ': 7,
    'BMI4AZ': 8
}




class AnthropometricResult(object):
    pass  # fields will be dynamically assigned in Python

NaN = float('NaN')  # the floating point value "Not A Number"

{'fraction_non_alphanumeric': 0.08958652373660031, 'fraction_numerical': 0.02526799387442573, 'mean_word_length': 3.776965265082267, 'pattern_counts': {'":': 0, '<': 4, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7541893', 'n_tokens_mistral': 922, 'n_tokens_neox': 835, 'n_words': 294}