code: def is_valid_aesthetic(value: Any, ae: str) -> bool:
      """
      Return True if `value` looks valid.
  
      Parameters
      ----------
      value :
          Value to check
      ae :
          Aesthetic name
  
      Notes
      -----
      There are no guarantees that he value is spot on
      valid.
      """
      if ae == "linetype":
          named = {
              "solid",
              "dashed",
              "dashdot",
              "dotted",
              "_",
              "--",
              "-.",
              ":",
              "None",
              " ",
              "",
          }
          if value in named:
              return True
  
          # tuple of the form (offset, (on, off, on, off, ...))
          # e.g (0, (1, 2))
          conditions = [
              isinstance(value, tuple),
              isinstance(value[0], int),
              isinstance(value[1], tuple),
              len(value[1]) % 2 == 0,
              all(isinstance(x, int) for x in value[1]),
          ]
          if all(conditions):
              return True
          return False
  
      elif ae == "shape":
          if isinstance(value, str):
              return True
  
          # tuple of the form (numsides, style, angle)
          # where style is in the range [0, 3]
          # e.g (4, 1, 45)
          conditions = [
              isinstance(value, tuple),
              all(isinstance(x, int) for x in value),
              0 <= value[1] < 3,
          ]
          if all(conditions):
              return True
          return False
  
      elif ae in {"color", "fill"}:
          if isinstance(value, str):
              return True
          with suppress(TypeError):
              if isinstance(value, (tuple, list)) and all(
                  0 <= x <= 1 for x in value
              ):
                  return True
          return False
  
      # For any other aesthetics we return False to allow
      # for special cases to be discovered and then coded
      # for appropriately.
      return False
  
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 9 for calling a global function with example usage: is_valid_aesthetic(value, ae) and returns: False, False, True, True, False, True, True, False, True, True