code: def entropy(counter):
      total_count = sum(counter.values())
      probs = np.array(
          [
              float(counter[bucket]) / float(total_count)
              for bucket in counter
          ]
      )
      return -probs.dot(np.log2(probs))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import io
  import sys
  import argparse
  import lz4.frame
  import tempfile
  import numpy
  from annoy import AnnoyIndex
  from collections import Counter
  from functools import partial
  from itertools import tee, chain
  from pymagnitude.third_party.allennlp.commands.elmo import ElmoEmbedder
  from pymagnitude.converter_shared import DEFAULT_PRECISION
  from pymagnitude.converter_shared import DEFAULT_NGRAM_BEG
  from pymagnitude.converter_shared import DEFAULT_NGRAM_END
  from pymagnitude.converter_shared import SQLITE_TOKEN_SPLITTERS
  from pymagnitude.converter_shared import BOW
  from pymagnitude.converter_shared import EOW
  from pymagnitude.converter_shared import CONVERTER_VERSION
  from pymagnitude import Magnitude, FeaturizerMagnitude
  from pymagnitude.converter_shared import fast_md5_file
  from pymagnitude.converter_shared import char_ngrams
  from pymagnitude.converter_shared import ibatch
label_desc: Use image node_id 3 for calling a global function with example usage: entropy(counter) and returns: unknown