def extractObjectDefinition(self, objDefJson):
        if 'objectId_' in objDefJson or 'objectDefinition_' in objDefJson:
            return self.convertObjectArgs(objDefJson)

        if 'type' not in objDefJson or 'args' not in objDefJson:
            raise MalformedMessageException("Malformed object definition given")

        objType = objDefJson['type']
        objectArgs = objDefJson['args']

        objectArgs = self.convertObjectArgs(objectArgs)

        if objType not in AllObjectClassesToExpose.classMap:
            raise InvalidObjectDefinitionException("Unknown object type")

        try:
            objectCls = AllObjectClassesToExpose.classMap[objType]
            result = objectCls(objectArgs)

            if not ComputedGraph.isLocation(result):
                result.__dict__['objectDefinition_'] = objDefJson

            return result
        except Exceptions.SubscribableWebObjectsException as e:
            raise InvalidObjectDefinitionException(e.message)
dataset/ETHPy150Open ufora/ufora/ufora/BackendGateway/SubscribableWebObjects/MessageProcessor.py/MessageProcessor.extractObjectDefinition/original