def bits_to_ip(bits):
    """
    Returns an IP when provided 32 bits
    :param bits: str ("11000000101010000000000000010111")
    :return: str ("192.168.0.23")
    """
    value = 128
    current = 1
    octet = {'1': '0', '2': '0', '3': '0', '4': '0'}
    for x in range(0, 32):
        if bits[x] == '1':
            octet[str(current)] = int(octet[str(current)]) + value
        if value == 1:
            value = 128
            current += 1
            continue
        value = value / 2
    return str(int(octet['1'])) + '.' + str(int(octet['2'])) + '.' + str(int
        (octet['3'])) + '.' + str(int(octet['4']))
