code: def has_task_labels(dataset):
      """Check if `dataset` has task labels."""
      return hasattr(dataset, "targets_task_labels")
  
imports: from typing import Dict, List, Optional, Sequence, Set, TypeVar, Union, overload
  import torch
  from .dataset_definitions import IDataset
  from .flat_data import ConstantSequence, FlatData
label_desc: Use image node_id 1 for calling a global function with example usage: has_task_labels(dataset) and returns: hasattr