class_docstr: Wrapper to get desired number of samples from underlying dataset only considering
  samples P for which mask[P] equals True
class_docstr_tok: ["Wrapper","to","get","desired","number","of","samples","from","underlying","dataset","only","considering","samples","P","for","which","mask","[","P","]","equals","True"]
code: def get_collate_fn(self) -> typing.Callable:
      get_collate_fn = getattr(self.dataset, "get_collate_fn", None)
      if callable(get_collate_fn):
          return get_collate_fn()
      return default_collate
  
file_path: pytorch-toolbelt/pytorch_toolbelt/datasets/wrappers.py
imports: import random
  import typing
  from typing import Any, Optional
  from torch.utils.data import Dataset
  import numpy
  from torch.utils.data.dataloader import default_collate
label_desc: Use image node_id 4 for calling the RandomSubsetWithMaskDataset obj's underlying member method code with example usage: obj.get_collate_fn() and returns: default_collate, get_collate_fn