<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _data_to_json(data):
 """Convert to json if it isn't already a string. Args: data (str):
 data to convert to json """

        if type(data) not in [str, unicode]:
            data = json.dumps(data)
        return data