from typing import Iterable


def clean_key(k: Iterable[str]) -> str:
    """
    Utility function for formatting keys.
    This is a no-op if the input is a string, otherwise expects an iterable
    of strings, which it joins with a period.
    """
    return k if isinstance(k, str) else '.'.join(k)