code: def wordfreq_to_weightsize(
      worddict, minsize=25, maxsize=50, minalpha=0.5, maxalpha=1.0
  ):
      mincount = min(worddict.itervalues())
      maxcount = max(worddict.itervalues())
      weights = {}
      for k, v in worddict.iteritems():
          w = (v - mincount) / (maxcount - mincount)
          alpha = minalpha + (maxalpha - minalpha) * w
          size = minsize + (maxsize - minsize) * w
          weights[k] = (alpha, size)
      return weights
  
label_desc: Use image node_id 3 for calling a global function with example usage: wordfreq_to_weightsize(worddict, minsize, maxsize, minalpha, maxalpha) and returns: weights