code: def _mask_and_crop_to_radius(
      image,
      target_radius_size,
      radius_mask_ratio=0.9,
      crop_to_radius=False,
  ):
      """Mask and crop image to the given radius ratio."""
      cv2 = tfds.core.lazy_imports.cv2
      mask = np.zeros(image.shape)
      center = (image.shape[1] // 2, image.shape[0] // 2)
      radius = int(target_radius_size * radius_mask_ratio)
      cv2.circle(
          mask,
          center=center,
          radius=radius,
          color=(1, 1, 1),
          thickness=-1,
      )
      image = image * mask + (1 - mask) * 128
      if crop_to_radius:
          x_max = min(image.shape[1] // 2 + radius, image.shape[1])
          x_min = max(image.shape[1] // 2 - radius, 0)
          y_max = min(image.shape[0] // 2 + radius, image.shape[0])
          y_min = max(image.shape[0] // 2 - radius, 0)
          image = image[y_min:y_max, x_min:x_max, :]
      return image
  
imports: import csv
  import io
  import os
  from absl import logging
  from etils import epath
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 5 for calling a global function with example usage: _mask_and_crop_to_radius(image, target_radius_size, radius_mask_ratio, crop_to_radius) and returns: image