def _int_to_bytes(self, length, byteorder, signed=False):
    assert byteorder == 'big' and signed is False
    if self < 0 or self >= 256**length:
        raise OverflowError()
    return bytearray(('%0*x' % (length * 2, self)).decode('hex'))

# int.from_bytes is Python 3.2+ only.
# s/int\.from_bytes(/_int_from_bytes(/g
dataset/ETHPy150Open saltstack/salt/salt/ext/ipaddress.py/_int_to_bytes/original