code: def _setup(
      dataset_dir,
      label_types=None,
      classes=None,
      attrs=None,
      seed=None,
      download=False,
  ):
      did_download = False
      _label_types = label_types
  
      if etau.is_str(classes):
          classes = [classes]
  
      if etau.is_str(attrs):
          attrs = [attrs]
  
      if seed is not None:
          random.seed(seed)
  
      # Map of class IDs to class names
      classes_map, _did_download = _get_classes_map(
          dataset_dir, download=download
      )
      classes_map_rev = {v: k for k, v in classes_map.items()}
      did_download |= _did_download
  
      all_classes = sorted(classes_map.values())
  
      if classes is not None:
          oi_classes = []
          missing_classes = []
          filtered_classes = []
          for c in classes:
              if c in classes_map_rev:
                  oi_classes.append(classes_map_rev[c])
                  filtered_classes.append(c)
              else:
                  missing_classes.append(c)
  
          classes = filtered_classes
          if missing_classes:
              logger.warning(
                  "Ignoring invalid classes %s\nYou can view the available "
                  "classes via `fiftyone.utils.openimages.get_classes()`",
                  missing_classes,
              )
      else:
          oi_classes = None
  
      if "relationships" in _label_types:
          # Map of attribute IDs to attribute names
          attrs_map, _did_download = _get_attrs_map(
              dataset_dir, download=download
          )
          attrs_map_rev = {v: k for k, v in attrs_map.items()}
          did_download |= _did_download
  
          all_attrs = sorted(attrs_map.values())
  
          if attrs is None:
              oi_attrs = [attrs_map_rev[a] for a in all_attrs]
          else:
              oi_attrs = []
              missing_attrs = []
              filtered_attrs = []
              for a in attrs:
                  if a in attrs_map_rev:
                      oi_attrs.append(attrs_map_rev[a])
                      filtered_attrs.append(a)
                  else:
                      missing_attrs.append(a)
  
              attrs = filtered_attrs
              if missing_attrs:
                  logger.warning(
                      "Ignoring invalid attributes %s\nYou can view the "
                      "available attributes via "
                      "`fiftyone.utils.openimages.get_attributes()`",
                      missing_attrs,
                  )
      else:
          attrs = None
          attrs_map = None
          oi_attrs = None
          all_attrs = None
  
      if "segmentations" in _label_types:
          seg_classes, _did_download = _get_seg_classes(
              dataset_dir, classes_map=classes_map, download=download
          )
          did_download |= _did_download
      else:
          seg_classes = None
  
      if "points" in _label_types:
          pnt_classes_map, _did_download = _get_pnt_classes_map(
              dataset_dir, classes_map=classes_map, download=download
          )
          did_download |= _did_download
      elif "points" not in _label_types:
          pnt_classes_map = None
  
      return (
          classes_map,
          all_classes,
          classes,
          oi_classes,
          attrs_map,
          all_attrs,
          attrs,
          oi_attrs,
          seg_classes,
          pnt_classes_map,
          did_download,
      )
  
imports: from collections import defaultdict
  import csv
  from glob import glob
  import logging
  import os
  import random
  import warnings
  import pandas
  import eta.core.image
  import eta.core.serial
  import eta.core.utils
  import eta.core.web
  import fiftyone
  import fiftyone.core.fields
  import fiftyone.core.labels
  import fiftyone.utils.aws
  import fiftyone.utils.data
  import fiftyone.utils.image
label_desc: Use image node_id 6 for calling a global function with example usage: _setup(dataset_dir, label_types, classes, attrs, seed, download) and returns: classes_map,  all_classes,  classes,  oi_classes,  attrs_map,  all_attrs,  attrs,  oi_attrs,  seg_classes,  pnt_classes_map,  did_download