code: def read_masks(img_ids):
      masks = []
      for img_id in img_ids:
          base_filename = "{}.png".format(img_id)
          mask = Image.open(
              os.path.join(settings.TRAIN_MASK_DIR, base_filename)
          )
          mask = np.asarray(
              mask.convert("L").point(lambda x: 0 if x < 128 else 1)
          ).astype(np.uint8)
          masks.append(mask)
      return masks
  
imports: import os
  import json
  import sys
  import time
  import numpy
  import pandas
  from PIL import Image
  from tqdm import tqdm
  from pycocotools import mask
  from sklearn.model_selection import KFold
  import settings
label_desc: Use image node_id 3 for calling a global function with example usage: read_masks(img_ids) and returns: masks