import string


def _get_str_format_keys(s: str) -> list:
    """Return the formatting keys present in a string `s`.

    Examples
    --------
    >>> _get_str_format_keys("foo {bar}")
    ['bar']
    >>> _get_str_format_keys("foo")
    []
    """
    # https://stackoverflow.com/a/46161774/5666087

    return [tup[1] for tup in string.Formatter().parse(s) if tup[1] is not None]