code: def two_digit_freqs(digits, normalize=False):
      """
      Consume digits of pi and compute 2 digits freq. counts.
      """
      freqs = np.zeros(100, dtype="i4")
      last = next(digits)
      this = next(digits)
      for d in digits:
          index = int(last + this)
          freqs[index] += 1
          last = this
          this = d
      if normalize:
          freqs = freqs / freqs.sum()
      return freqs
  
file_path: ipyparallel/docs/source/examples/pi/pidigits.py
imports: import os
  from urllib.request import urlretrieve
  import numpy
  from matplotlib import pyplot
label_desc: Use image node_id 8 for calling a global function with example usage: two_digit_freqs(digits, normalize) and returns: freqs