<commit_before>## Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
#
# This program is available from Source Forge: at GeneNetwork Project
# (sourceforge.net/projects/genenetwork/).
#
# Contact Dr. <NAME> at <EMAIL>
#
#
# This module is used by GeneNetwork project (www.genenetwork.org)

import datetime
import math
import numpy as np
import scipy

from rpy2.robjects.packages import importr
import rpy2.robjects as robjects

from pprint import pformat as pf

from utility.redis_tools import get_redis_conn
try:  # Only import this for Python3
    from functools import reduce
except:
    pass
Redis = get_redis_conn()
THIRTY_DAYS = 60 * 60 * 24 * 30

from utility.THCell import THCell
from utility.TDCell import TDCell
from base.trait import GeneralTrait
from base import data_set
from utility import webqtlUtil, helper_functions, corr_result_helpers

from db import webqtlDatabaseFunction
import utility.webqtlUtil #this is for parallel computing only.
from wqflask.correlation import correlation_functions
from utility.benchmark import Bench

from flask import Flask, g, url_for

import utility.logger
logger = utility.logger.getLogger(__name__ )

class CorrelationMatrix(object):

    def __init__(self, start_vars):
        trait_db_list = [trait.strip() for trait in start_vars['trait_list'].split(',')]

        helper_functions.get_trait_db_obs(self, trait_db_list)
<commit_msg>Import "reduce" without a try block<commit_after>## Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
#
# This program is available from Source Forge: at GeneNetwork Project
# (sourceforge.net/projects/genenetwork/).
#
# Contact Dr. <NAME> at <EMAIL>
#
#
# This module is used by GeneNetwork project (www.genenetwork.org)

import datetime
import math
import numpy as np
import scipy

from rpy2.robjects.packages import importr
import rpy2.robjects as robjects

from pprint import pformat as pf

from utility.redis_tools import get_redis_conn
from functools import reduce

Redis = get_redis_conn()
THIRTY_DAYS = 60 * 60 * 24 * 30

from utility.THCell import THCell
from utility.TDCell import TDCell
from base.trait import GeneralTrait
from base import data_set
from utility import webqtlUtil, helper_functions, corr_result_helpers

from db import webqtlDatabaseFunction
import utility.webqtlUtil #this is for parallel computing only.
from wqflask.correlation import correlation_functions
from utility.benchmark import Bench

from flask import Flask, g, url_for

import utility.logger
logger = utility.logger.getLogger(__name__ )

class CorrelationMatrix(object):

    def __init__(self, start_vars):
        trait_db_list = [trait.strip() for trait in start_vars['trait_list'].split(',')]

        helper_functions.get_trait_db_obs(self, trait_db_list)

{'fraction_non_alphanumeric': 0.060247303341225994, 'fraction_numerical': 0.006051039200210471, 'mean_word_length': 4.949921752738654, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3104420', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1082, 'n_words': 453}