code: def random_square_mask(shape, fraction):
      """Create a numpy array with specified shape and masked fraction.
  
      Args:
        shape: tuple, shape of the mask to create.
        fraction: float, fraction of the mask area to populate with `mask_scalar`.
  
      Returns:
        numpy.array: A numpy array storing the mask.
      """
  
      mask = np.ones(shape)
  
      patch_area = shape[0] * shape[1] * fraction
      patch_dim = int(math.floor(math.sqrt(patch_area)))
      if patch_area == 0 or patch_dim == 0:
          return mask
  
      x = np.random.randint(shape[0] - patch_dim)
      y = np.random.randint(shape[1] - patch_dim)
  
      mask[x : (x + patch_dim), y : (y + patch_dim), :] = 0
  
      return mask
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from io import BytesIO
  import math
  import os
  import numpy
  import requests
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import image_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import metrics
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling a global function with example usage: random_square_mask(shape, fraction) and returns: mask, mask