def find_the_correct_casing(key: str, data: dict[str, Any]) -> str | None:
    """Given a key, find the proper casing in data.

    Return 'None' for non-str key types.

    Arguments:
        key {str} -- A key to be searched in data
        data {dict} -- A dict to be searched

    Returns:
        str -- The proper casing of the key in data
    """
    if not isinstance(key, str) or key in data:
        return key
    for k in data.keys():
        if not isinstance(k, str):
            return None
        if k.lower() == key.lower():
            return k
        if k.replace(" ", "_").lower() == key.lower():
            return k
    return None
Given a key, find the proper casing in data.

    Return 'None' for non-str key types.

    Arguments:
        key {str} -- A key to be searched in data
        data {dict} -- A dict to be searched

    Returns:
        str -- The proper casing of the key in data
    
dynaconf/utils/__init__.py