<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize_to_json(self, name, datas):
 """ Serialize given datas to any object from assumed JSON string. Arguments: name (string):
 Name only used inside possible exception message. datas (dict):
 Datas to serialize. Returns: object: Object depending from JSON content. """

        data_object = datas.get('object', None)

        if data_object is None:
            msg = ("JSON reference '{}' lacks of required 'object' variable")
            raise SerializerError(msg.format(name))

        try:
            content = json.loads(data_object, object_pairs_hook=OrderedDict)
        except json.JSONDecodeError as e:
            msg = "JSON reference '{}' raised error from JSON decoder: {}"
            raise SerializerError(msg.format(name, e))
        else:
            return content