code: def _process_image_file(
      fobj, session, filename, quality=None, target_pixels=None
  ):
      """Process image files from the dataset."""
      # We need to read the image files and convert them to JPEG, since some files
      # actually contain GIF, PNG or BMP data (despite having a .jpg extension) and
      # some encoding options that will make TF crash in general.
      image = _decode_image(fobj, session, filename=filename)
      # Get image height and width.
      height, width, _ = image.shape
      actual_pixels = height * width
      if target_pixels and actual_pixels > target_pixels:
          factor = np.sqrt(target_pixels / actual_pixels)
          image = tfds.core.lazy_imports.cv2.resize(
              image, dsize=None, fx=factor, fy=factor
          )
      return _encode_jpeg(image, quality=quality)
  
imports: import io
  import os
  from absl import logging
  import numpy
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling a global function with example usage: _process_image_file(fobj, session, filename, quality, target_pixels) and returns: _encode_jpeg