import six


def key_not_string(d):
    """Helper function to recursively determine if any key in a
    dictionary is not a string.
    """
    for k, v in d.items():
        if not isinstance(k, six.string_types) or (isinstance(v, dict) and key_not_string(v)):
            return True