<commit_before>''' Frequently used constants '''

__all__ = ["RMISSD", "ROCP", "ZEROCNK", "G"]

RMISSD = -9999.0            # Missing Flag
ROCP = 0.28571426           # R divided by Cp
ZEROCNK = 273.15            # Zero Celsius in Kelvins
G = 9.80665                 # Earth's Gravity<commit_msg>Added conversion and checking functions to the constants library.<commit_after>''' Frequently used constants '''

consts = ["RMISSD", "ROCP", "ZEROCNK", "G"]
funcs = ['MS2KTS', 'QC']
__all__ = consts + funcs


# Constants
RMISSD = -9999.0            # Missing Flag
ROCP = 0.28571426           # R divided by Cp
ZEROCNK = 273.15            # Zero Celsius in Kelvins
G = 9.80665                 # Earth's Gravity



# Functions
def MS2KTS(val):
    '''
    Convert meters per second to knots

    Inputs
    ------
        val     (float)         Speed (m/s)

    Returns
    -------
        Val converted to knots (float)
    '''
    return val * 1.94384449


def QC(val):
    '''
    Check to see if given data is missing

    Inputs
    ------
        val     (float)         Value to check

    Returns
    -------
        1 if value is good
        0 if value is bad
    '''
    if val < -998.0 or val > 2.0e5: return 0
    return 1
{'fraction_non_alphanumeric': 0.12022745735174654, 'fraction_numerical': 0.05848903330625508, 'mean_word_length': 1.7256637168141593, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3925335', 'n_tokens_mistral': 457, 'n_tokens_neox': 397, 'n_words': 132}