code: def aes_to_scale(var: str):
      """
      Look up the scale that should be used for a given aesthetic
      """
      if var in {"x", "xmin", "xmax", "xend", "xintercept"}:
          var = "x"
      elif var in {"y", "ymin", "ymax", "yend", "yintercept"}:
          var = "y"
      return var
  
imports: from __future__ import annotations
  import re
  import typing
  from collections.abc import Iterable, Sequence
  from contextlib import suppress
  from copy import deepcopy
  from dataclasses import fields
  from typing import Any, Dict
  import pandas
  from ..iapi import labels_view
  from .evaluation import after_stat, stage
label_desc: Use image node_id 6 for calling a global function with example usage: aes_to_scale(var) and returns: var