code: def _sanitise_keys(
      by: Sequence[GroupingKey],
      keys: Any,
      plotters: Collection[Plotter],
  ) -> Tuple[Tuple[str, ...], Collection[Plotter]]:
      """
      Sanitises keys from Pandas group_by.
  
      Takes the keys from Pandas group_by, which can have all sorts of types, and:
      * Separates the plotters from the "regular" keys.
      * Converts the "regular" keys to strings.
      """
      result_keys: List[str] = []
      result_plotters = plotters
      if not isinstance(keys, tuple):
          keys = (keys,)
  
      for b, k in zip(by, keys):
          if b.key_type == Plotter:
              assert result_plotters == plotters
              result_plotters = tuple(
                  p for p in plotters if p.name == k
              )
          else:
              key_repr = k if b.key_type == str else repr(k)
              if b.prefix_key_to_value:
                  key_repr = f"{b.key_name}={key_repr}"
              result_keys.append(key_repr)
  
      return tuple(result_keys), result_plotters
  
imports: import heapq
  from dataclasses import dataclass
  from enum import Enum
  from typing import Any, Collection, Iterator, List, Sequence, Tuple, Type
  import pandas
  from benchmark.metadata import BenchmarkMetadata
  from benchmark.plotter_api import Plotter
label_desc: Use image node_id 3 for calling a global function with example usage: _sanitise_keys(by, keys, plotters) and returns: tuple,  result_plotters