from typing import Mapping


def _get_plot_file_name(plot_name: str,
            plot_configuration: Mapping[str, str]) -> str:
  """"Return unique file name for the plot configuration.

  Concat the plot configuration key value pairs and remove special
  characters that may not be supported by the file system.

  Example:
  {'expert': 'SingleTilingExpert', 'np_types': 'float32,float32,float32'}
  ->
  'plot_name_expert_SingleTilingExpert_np_types_float32float32float32.pdf'
  """
  file_name = plot_name
  for k, v in plot_configuration.items():
    alphanumeric = "".join([c for c in v if c.isalnum()])
    file_name += str.format(f"_{k}_{alphanumeric}")
  file_name += ".pdf"
  return file_name