# Path: corpkit/constants.py
# STRINGTYPE = str if PYTHON_VERSION == 3 else basestring
# 
# PYTHON_VERSION = sys.version_info.major


from corpkit.constants import STRINGTYPE, PYTHON_VERSION
    from pandas import DataFrame, Series
    from collections import Counter
    from corpkit.interrogation import Interrogation
        from corpkit.other import load
        import math
        """
        # get total num words in ref corpus
        key_scores = {}
        ref_sum = sum(reference_corpus.values())
        if isinstance(target_corpus, dict):
            target_sum = sum(target_corpus.values())
        if isinstance(target_corpus, Series):
            target_sum = target_corpus.sum()

        # get words to calculate
        if calc_all:
            wordlist = list(set(list(target_corpus.keys()) + list(reference_corpus.keys())))
        else:
            wordlist = list(target_corpus.keys())
        wordlist = [(word, reference_corpus[word]) for word in wordlist]
        for w, s in wordlist:
            if s < threshold:
                global skipped
                skipped += 1
                continue
            word_in_ref = reference_corpus.get(w, 0)
            word_in_target = target_corpus.get(w, 0)
            if kwargs.get('only_words_in_both_corpora'):
                if word_in_ref == 0:
                    continue
            score = measure_func(word_in_ref, word_in_target, ref_sum, target_sum)
            key_scores[w] = score
        return key_scores

    # load string ref corp 

# Path: corpkit/constants.py
# STRINGTYPE = str if PYTHON_VERSION == 3 else basestring
# 
# PYTHON_VERSION = sys.version_info.major


# Path: corpkit/keys.py
from corpkit.constants import STRINGTYPE, PYTHON_VERSION
    from pandas import DataFrame, Series
    from collections import Counter
    from corpkit.interrogation import Interrogation
        from corpkit.other import load
        import math

        """
        # get total num words in ref corpus
        key_scores = {}
        ref_sum = sum(reference_corpus.values())
        if isinstance(target_corpus, dict):
            target_sum = sum(target_corpus.values())
        if isinstance(target_corpus, Series):
            target_sum = target_corpus.sum()

        # get words to calculate
        if calc_all:
            wordlist = list(set(list(target_corpus.keys()) + list(reference_corpus.keys())))
        else:
            wordlist = list(target_corpus.keys())
        wordlist = [(word, reference_corpus[word]) for word in wordlist]
        for w, s in wordlist:
            if s < threshold:
                global skipped
                skipped += 1
                continue
            word_in_ref = reference_corpus.get(w, 0)
            word_in_target = target_corpus.get(w, 0)
            if kwargs.get('only_words_in_both_corpora'):
                if word_in_ref == 0:
                    continue
            score = measure_func(word_in_ref, word_in_target, ref_sum, target_sum)
            key_scores[w] = score
        return key_scores

    # load string ref corp 

    if isinstance(reference_corpus, STRINGTYPE):