'Creates a python datastructure from the given data, which can be either
a JSON or YAML string.'

def load(self, data, file_name='<string>', show_content=True):

    new_data = None
    if isinstance(data, AnsibleUnicode):
        in_data = text_type(data)
    else:
        in_data = data
    try:
        new_data = json.loads(data)
    except:
        if isinstance(data, AnsibleUnicode):
            in_data = text_type(data)
        else:
            in_data = data
        try:
            new_data = self._safe_load(in_data, file_name=file_name)
        except YAMLError as yaml_exc:
            self._handle_error(yaml_exc, file_name, show_content)
        if isinstance(data, AnsibleUnicode):
            new_data = AnsibleUnicode(new_data)
            new_data.ansible_pos = data.ansible_pos
    return new_data
