code: def _get_migration_error(name: str):
      return AttributeError(
          f"The new `ray.train.Checkpoint` class does not support `{name}()`. "
          f"Instead, only directories are supported.\n\n"
          f"Example to store a dictionary in a checkpoint:\n\n"
          f"import os, tempfile\n"
          f"import ray.cloudpickle as pickle\n"
          f"from ray import train\n"
          f"from ray.train import Checkpoint\n\n"
          f"with tempfile.TemporaryDirectory() as checkpoint_dir:\n"
          f"  with open(os.path.join(checkpoint_dir, 'data.pkl'), 'wb') as fp:\n"
          f"    pickle.dump({{'data': 'value'}}, fp)\n\n"
          f"  checkpoint = Checkpoint.from_directory(checkpoint_dir)\n"
          f"  train.report(..., checkpoint=checkpoint)\n\n"
          f"Example to load a dictionary from a checkpoint:\n\n"
          f"if train.get_checkpoint():\n"
          f"  with train.get_checkpoint().as_directory() as checkpoint_dir:\n"
          f"    with open(os.path.join(checkpoint_dir, 'data.pkl'), 'rb') as fp:\n"
          f"      data = pickle.load(fp)"
      )
  
imports: import contextlib
  import glob
  import json
  import logging
  import os
  import platform
  import shutil
  import tempfile
  import traceback
  import uuid
  from typing import Any, Dict, Iterator, List, Optional, Union
  import pyarrow.fs
  from ray.air._internal.filelock import TempFileLock
  from ray.train._internal.storage import _download_from_fs_path, _exists_at_fs_path
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 3 for calling a global function with example usage: _get_migration_error(name) and returns: AttributeError