code: def _make_kernel_constraint(kernel_size, valid_rows, valid_columns):
      """Make the masking function for layer kernels."""
      mask = np.zeros(kernel_size)
      lower, upper = valid_rows
      left, right = valid_columns
      mask[lower:upper, left:right] = 1.0
      mask = mask[:, :, np.newaxis, np.newaxis]
      return lambda x: x * mask
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import numpy
  import warnings
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import logistic
  from tensorflow_probability.python.distributions import mixture_same_family
  from tensorflow_probability.python.distributions import quantized_distribution
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 1 for calling a global function with example usage: _make_kernel_constraint(kernel_size, valid_rows, valid_columns) and returns: function