def prettify(s):
  """Universal function to prettify all strings.

  Intended use:
  Never directly change strings in the dataframe because it's confusing.

  Instead, use `plotting.apply_to_fig_text(fig_handle, prettify_names)` on any
  figure to automaticaly change all labels, titles and other strings in the
  figure to the pretty version.

  Args:
    s: String/name as used in the database.

  Returns:
    Pretty string for use in a figure.
  """
  pretty_name = {
      # Datasets:
      "imagenet": "ImageNet",
      "imagenet(split='validation[20%:]')": "ImageNet",
      "imagenet_a": "ImageNet-A",
      "imagenet_r": "ImageNet-R",
      "imagenet_v2": "ImageNet-v2",
      "imagenet_v2(variant='MATCHED_FREQUENCY')": "ImageNet-v2",
      "objectnet": "ObjectNet",
      "jft": "JFT-300M",
      "imagenet21k": "ImageNet-21k",

      # Model families:
      "vit": "ViT",
      "bit": "BiT",
      "simclr": "SimCLR",
      "efficientnet-noisy-student": "EfficientNet-NS",
      "efficientnet-b0": "EfficientNet-B0",
      "efficientnet-b4": "EfficientNet-B4",
      "jax-bit-imagenet-r50-x1": "BiT-S R50x1",
      "alexnet": "AlexNet",
      "clip": "CLIP",
      "vgg": "VGG",
      "wsl": "ResNeXt WSL",
      "mixer": "MLP-Mixer",
      "guo": "Guo et al.",

      # Model names:
      "vit-b/32": "ViT-B/32",
      "vit-b/16": "ViT-B/16",
      "vit-l/32": "ViT-L/32",
      "vit-l/16": "ViT-L/16",
      "vit-h/14": "ViT-H/14",

      "bit-jft-r50-x1": "BiT-L (R50x1)",
      "bit-jft-r101-x1": "BiT-L (R101x1)",
      "bit-jft-r50-x3": "BiT-L (R50x3)",
      "bit-jft-r101-x3": "BiT-L (R101x3)",
      "bit-jft-r152-x4-480": "BiT-L (R152x4)",

      "simclr-1x-fine-tuned-100": "SimCLR-1x",
      "simclr-2x-fine-tuned-100": "SimCLR-2x",
      "simclr-4x-fine-tuned-100": "SimCLR-4x",

      "efficientnet-noisy-student-b1": "EffNet-B1-NS",
      "efficientnet-noisy-student-b3": "EffNet-B3-NS",
      "efficientnet-noisy-student-b5": "EffNet-B5-NS",
      "efficientnet-noisy-student-b7": "EffNet-B7-NS",

      "wsl_32x8d": "WSL 32x8d",
      "wsl_32x16d": "WSL 32x16d",
      "wsl_32x32d": "WSL 32x32d",
      "wsl_32x48d": "WSL 32x48d",

      "clip_r50": "CLIP R50",
      "clip_r101": "CLIP R101",
      "clip_r50x4": "CLIP R50x4",
      "clip_vit_b32": "CLIP ViT-B/32",

      "mixer/jft-300m/B/16": "MLP-Mixer-B/16",
      "mixer/jft-300m/L/16": "MLP-Mixer-L/16",
      "mixer/jft-300m/H/14": "MLP-Mixer-H/14",
      "mixer/jft-2.5b/H/14": "MLP-Mixer-H/14 (2.5B)",

      # Other:
      "size varies": "Pretraining dataset size\n(num. examples)",
      "steps varies": "Pretraining duration\n(steps)",
      "temperature_scaling": "Temperature scaling",
  }

  # If no pretty version is defined, return the original string:
  return pretty_name.get(s, s)