def dotted_netmask(mask):
    """
    Converts mask from /xx format to xxx.xxx.xxx.xxx
    Example: if mask is 24 function returns 255.255.255.0
    """
    bits = 0xffffffff ^ 1 - (1 << 32 - mask)
    return socket.inet_ntoa(struct.pack('>I', bits))
dataset/ETHPy150Open kennethreitz/requests/requests/utils.py/dotted_netmask/swapped operands of `-`