code: def download(directory, filename):
      """Downloads a file."""
      filepath = os.path.join(directory, filename)
      if tf.io.gfile.exists(filepath):
          return filepath
      if not tf.io.gfile.exists(directory):
          tf.io.gfile.makedirs(directory)
      url = os.path.join(BERNOULLI_PATH, filename)
      print("Downloading %s to %s" % (url, filepath))
      urllib.request.urlretrieve(url, filepath)
      return filepath
  
imports: import functools
  import os
  import time
  from absl import flags
  from matplotlib import cm
  from matplotlib import figure
  from matplotlib.backends import backend_agg
  import numpy
  from six.moves import urllib
  import tensorflow.compat.v1
  from tensorflow_probability import distributions
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow.contrib.learn.python.learn.datasets import mnist
  from tensorflow.python.training import moving_averages
label_desc: Use image node_id 7 for calling a global function with example usage: download(directory, filename) and returns: filepath, filepath