code: def retrieve_openml(
      cache_dir: str = None,
  ) -> Generator[SupervisedDataset]:
      """Retrives OpenML CC18 datasets.
  
      Args:
          cache_dir (str, optional): Use this cache directory across calls. Defaults to None.
  
      Yields:
          Generator[SupervisedDataset]: Yields datasets.
      """
      import openml
  
      if cache_dir is not None:
          cache_dir = pathlib.Path(cache_dir, "openml")
  
      suite = openml.study.get_suite(99)
      tasks = suite.tasks.copy()
      random.Random(1337).shuffle(tasks)
      for task_id in tqdm(tasks, desc="openml"):
          task = openml.tasks.get_task(task_id)
          dataset = openml.datasets.get_dataset(
              task.dataset_id, download_data=False
          )
          name = dataset.name
          X_name = f"{name}.X.parquet"
          y_name = f"{name}.y.parquet"
          meta_name = f"{name}.meta.json"
          problem = (
              "binary"
              if dataset.qualities["NumberOfClasses"] == 2
              else "multiclass"
          )
  
          cached = retrieve_cache(
              cache_dir, [X_name, y_name, meta_name]
          )
          if cached is None:
              (
                  X,
                  y,
                  categorical_mask,
                  feature_names,
              ) = task.get_dataset().get_data(
                  target=task.target_name, dataset_format="dataframe"
              )
              meta = {
                  "name": name,
                  "problem": problem,
                  "source": "openml",
                  "categorical_mask": categorical_mask,
                  "feature_names": feature_names,
              }
              supervised = SupervisedDataset(X, y, meta)
          else:
              supervised = SupervisedDataset.deserialize(*cached)
  
          if cache_dir is not None:
              serialized = SupervisedDataset.serialize(supervised)
              update_cache(
                  cache_dir, [X_name, y_name, meta_name], serialized
              )
          yield supervised
  
imports: import pytz
  import base64
  from dataclasses import dataclass
  from typing import Any, Dict, Generator, Iterable, List, Optional, Tuple, Type
  import random
  import random
  from powerlift.db.actions import delete_db, create_db
  from powerlift.measures import class_stats, data_stats, regression_stats
  from sqlalchemy.exc import IntegrityError
  from sqlalchemy import create_engine
  from tqdm import tqdm
  from itertools import chain
  from sqlalchemy.orm import Session
  import io
  import os
  from powerlift.db import schema
  import numbers
  from datetime import datetime
  import pathlib
  import pandas
  import ast
label_desc: Use image node_id 7 for calling a global function with example usage: retrieve_openml(cache_dir) without return types