def _encode(self, value):
        length = len(value)
        if self.getSize() is not None:
            if length != self.getSize():
                raise ValueError("Value (%s) size %d does not match expected %d" % (value, length, self.getSize()))

        return value
dataset/ETHPy150Open jookies/jasmin/jasmin/vendor/smpp/pdu/pdu_encoding.py/OctetStringEncoder._encode/original