original_docstring: 
          get keywords in target corpus compared to reference corpus
          this should probably become some kind of row-wise df.apply method
          
docstring: get keywords in target corpus compared to reference corpus
  this should probably become some kind of row-wise df.apply method
docstring_tokens: get keywords in target corpus compared to reference corpus this should probably become some kind of row - wise df . apply method
code: def calc_keywords(target_corpus, reference_corpus):
          """
          get keywords in target corpus compared to reference corpus
          this should probably become some kind of row-wise df.apply method
          """
          # 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
code_tokens: def calc_keywords ( target_corpus , reference_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 ( ) 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
short_docstring: get keywords in target corpus compared to reference corpus
  this should probably become some kind of row-wise df.apply method
short_docstring_tokens: get keywords in target corpus compared to reference corpus this should probably become some kind of row - wise df . apply method
comment: """
          get keywords in target corpus compared to reference corpus
          this should probably become some kind of row-wise df.apply method
          """$SEP$# get total num words in ref corpus$SEP$# get words to calculate