code: def load_dataset(
      day_index: int = 0,
      batch_size: int = 32,
      num_workers: int = 0,
      pin_memory: bool = True,
      shuffle: bool = False,
      object_type: Literal["VisionData", "DataLoader"] = "DataLoader",
  ) -> t.Union[DataLoader, VisionData]:
      """Get the mask dataset and return a dataloader.
  
      Parameters
      ----------
      day_index : int, default: 0
          Select the index of the day that should be loaded. 0 is the training set, and each subsequent number is a
          subsequent day in the production dataset. Last day index is 59.
      batch_size : int, default: 32
          Batch size for the dataloader.
      num_workers : int, default: 0
          Number of workers for the dataloader.
      shuffle : bool, default: False
          Whether to shuffle the dataset.
      pin_memory : bool, default: True
          If ``True``, the data loader will copy Tensors
          into CUDA pinned memory before returning them.
      object_type : Literal['Dataset', 'DataLoader'], default: 'DataLoader'
          type of the return value. If 'Dataset', :obj:`deepchecks.vision.VisionData`
          will be returned, otherwise :obj:`torch.utils.data.DataLoader`
  
      Returns
      -------
      Union[DataLoader, VisionDataset]
  
          A DataLoader or VisionDataset instance representing mask dataset
      """
      mask_dir = MaskDataset.download_mask(MASK_DIR)
      time_to_sample_dict = MaskDataset.get_time_to_sample_dict(
          MASK_DIR
      )
      if (
          not isinstance(day_index, int)
          or day_index < 0
          or day_index > 59
      ):
          raise ValueError(
              "day_index must be an integer between 0 and 59"
          )
      time = list(time_to_sample_dict.keys())[day_index]
      samples_to_use = time_to_sample_dict[time]
      if shuffle:
          sampler = torch.utils.data.SubsetRandomSampler(
              samples_to_use, generator=torch.Generator()
          )
      else:
          sampler = IndicesSequentialSampler(samples_to_use)
  
      dataset = MaskDataset(
          mask_dir=str(mask_dir),
          transform=transforms.Compose(
              [
                  transforms.ToTensor(),
              ]
          ),
      )
      if object_type == "DataLoader":
          return DataLoader(
              dataset=dataset,
              batch_size=batch_size,
              num_workers=num_workers,
              collate_fn=_batch_collate,
              pin_memory=pin_memory,
              sampler=sampler,
          )
      elif object_type == "VisionData":
          model = load_model()
          dataloader = DataLoader(
              dataset=dataset,
              batch_size=batch_size,
              num_workers=num_workers,
              sampler=sampler,
              collate_fn=deepchecks_collate(model),
              pin_memory=pin_memory,
          )
          return VisionData(
              dataloader,
              task_type="object_detection",
              reshuffle_data=False,
              label_map=LABEL_MAP,
              dataset_name=f"Mask Dataset at time {time}",
          )
      else:
          raise TypeError(
              f"Unknown value of object_type - {object_type}"
          )
  
imports: import contextlib
  import hashlib
  import json
  import os
  import pathlib
  import typing
  import urllib.request
  from pathlib import Path
  import numpy
  import torch
  from bs4 import BeautifulSoup
  from PIL import Image
  from torch import nn
  from torch.utils.data import DataLoader
  from typing_extensions import Literal
  from deepchecks.vision.utils.test_utils import IndicesSequentialSampler
  from deepchecks.vision.vision_data import BatchOutputFormat, VisionData
  from deepchecks.vision.vision_data.utils import object_to_numpy
label_desc: Use image node_id 4 for calling a global function with example usage: load_dataset(day_index, batch_size, num_workers, pin_memory, shuffle, object_type) and returns: DataLoader, VisionData