code: def weighted_dataloaders(
      self: DataBlock,
      source,
      wgts,
      bs=64,
      verbose: bool = False,
      **kwargs,
  ):
      "Create a weighted dataloader `WeightedDL` with `wgts` for the dataset"
      dss = self.datasets(source, verbose=verbose)
      if not hasattr(wgts, "__array__"):
          wgts = np.array(wgts)
      trn_wgts = wgts[dss.splits[0]]
      return dss.weighted_dataloaders(
          trn_wgts,
          bs=bs,
          after_batch=self.batch_tfms,
          after_item=self.item_tfms,
          **kwargs,
      )
  
file_path: fastai/fastai/callback/data.py
imports: from __future__ import annotations
  from ..basics import *
label_desc: Use image node_id 2 for calling a global function with example usage: weighted_dataloaders(source, wgts, bs, verbose) and returns: dss