code: def penalize_boundary_complexity(shp, w=20, mask=None, C=0.5):
      """Encourage the boundaries of an image to have less variation and of color C.
  
      Args:
        shp: shape of T("input") because this may not be known.
        w: width of boundary to penalize. Ignored if mask is set.
        mask: mask describing what area should be penalized.
  
      Returns:
        Objective.
      """
  
      def inner(T):
          arr = T("input")
  
          # print shp
          if mask is None:
              mask_ = np.ones(shp)
              mask_[:, w:-w, w:-w] = 0
          else:
              mask_ = mask
  
          blur = _tf_blur(arr, w=5)
          diffs = (blur - arr) ** 2
          diffs += 0.8 * (arr - C) ** 2
  
          return -tf.reduce_sum(diffs * mask_)
  
      return inner
  
imports: from __future__ import absolute_import, division, print_function
  from decorator import decorator
  import numpy
  import tensorflow
  from lucid.optvis.objectives_util import _dot, _dot_cossim, _extract_act_pos, _make_arg_str, _T_force_NHWC, _T_handle_batch
label_desc: Use image node_id 16 for calling a global function with example usage: penalize_boundary_complexity(shp, w, mask, C) and returns: inner, unknown