<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def keys_to_string(data):
 """ Function to convert all the unicode keys in string keys """

    if isinstance(data, dict):
        for key in list(data.keys()):
            if isinstance(key, six.string_types):
                value = data[key]
                val = keys_to_string(value)
                del data[key]
                data[key.encode("utf8", "ignore")] = val
    return data