def decodeOptionalParams(self, paramList, file, optionsLength):
        optionalParams = {}
        iBefore = file.tell()
        while file.tell() - iBefore < optionsLength:
            option = self.optionEncoder.decode(file)
            optionName = str(option.tag)
            if optionName not in paramList:
                raise PDUParseError("Invalid option %s" % optionName, pdu_types.CommandStatus.ESME_ROPTPARNOTALLWD)
            optionalParams[optionName] = option.value
        return optionalParams
dataset/ETHPy150Open jookies/jasmin/jasmin/vendor/smpp/pdu/pdu_encoding.py/PDUEncoder.decodeOptionalParams/original