def _to_bytes(value, length, dummy, _unhexlify=_unhexlify):
        """An implementation of int.to_bytes for python 2.x."""
        fmt = '%%0%dx' % (2 * length,)
        return _unhexlify(fmt % value)
An implementation of int.to_bytes for python 2.x.
stackoverflow/venv/lib/python3.6/site-packages/pymongo/auth.py