code: def hex_digest(x):
      """
      Returns a short, mostly hexadecimal hash of a numpy ndarray
      """
      assert isinstance(x, np.ndarray)
      rval = hashlib.sha256(x.tostring()).hexdigest()
      # hex digest must be annotated with strides to avoid collisions
      # because the buffer interface only exposes the raw data, not
      # any info about the semantics of how that data should be arranged
      # into a tensor
      rval = (
          rval
          + "|strides=["
          + ",".join(str(stride) for stride in x.strides)
          + "]"
      )
      rval = rval + "|shape=[" + ",".join(str(s) for s in x.shape) + "]"
      return rval
  
imports: from __future__ import absolute_import, print_function, division
  from copy import copy
  import logging
  import os
  import sys
  import hashlib
  import numpy
  from six import string_types, integer_types, iteritems
  from six.moves import StringIO, reduce
  import theano
  from theano import gof
  from theano import config
  from theano.gof import Op, Apply
  from theano.compile import Function, debugmode, SharedVariable
label_desc: Use image node_id 7 for calling a global function with example usage: hex_digest(x) and returns: rval