<commit_before>#!/usr/bin/python

import sys

def parseMatrix(matrix_file):
    matrix = {
              'threat1': {'habitat1': 4, 'habitat2':2} ,
              'threat2': {'habitat1': 3, 'habitat2':1} 
             }
    # TODO read csv
    # TODO put into dictionary
    #      (if something goes wrong, throw exception)
    return matrix

def processThreatHabitatCombo(threat,habitat,weight):
    # TODO make sure both layers exist
    # TODO mapcalc em together
    valid = True
    output = threat + "_" + habitat
    return {'valid': valid, 'output': output }

def processAllCombos(combos):<commit_msg>Added some useful summary comments<commit_after>#!/usr/bin/python
"""
  Threat Matrix Combination Model

  For each threat/habit combo, combine them according to
  weighting defined in a matrix file. The final output
  is the sum of all weighted combinations.

  The matrix file will have the following format:

    ,habitat1,habitat2
    threat1,4,2
    threat2,3,1

  Author: <NAME>
  Date: 09/26/2006
"""

import sys

def parseMatrix(matrix_file):
    matrix = {
              'threat1': {'habitat1': 4, 'habitat2':2} ,
              'threat2': {'habitat1': 3, 'habitat2':1} 
             }
    # TODO read csv
    # TODO put into dictionary
    #      (if something goes wrong, throw exception)
    return matrix

def processThreatHabitatCombo(threat,habitat,weight):
    # TODO make sure both layers exist
    # TODO mapcalc em together
    valid = True
    output = threat + "_" + habitat
    return {'valid': valid, 'output': output }

def processAllCombos(combos):
{'fraction_non_alphanumeric': 0.10309930423782417, 'fraction_numerical': 0.022770398481973434, 'mean_word_length': 2.886977886977887, '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': '6682472', 'n_tokens_mistral': 499, 'n_tokens_neox': 476, 'n_words': 152}