from typing import Any


def _is_compound_key(s: Any) -> bool:
  """ compound key is defined as a string which uses square brackets to enclose
  a comma-separated list, e.g. "[batch_size,learning_rate]" or "[a,b,c]"
  """

  if type(s) is not str or len(s) <= 2:
    return False
  else:
    return s[0] == '[' and s[-1] == ']'