human
Here's a good function header given the following:
I wrote the below code

    def check(r0, r1):
        a = r0.toUnsigned()
        b = r1
        if ((not allow_host) and (a & ((1 << b) - 1))):
            raise RuntimeError(('Host    part    of    CIDR    address    is    not    zero    (%s)' % (addr,)))
        return (r0, (32 - r1))
    addr = addr.split('/', 2)
    if (len(addr) == 1):
        if (infer is False):
            return check(IPAddr(addr[0]), 0)
        addr = IPAddr(addr[0])
        b = (32 - infer_netmask(addr))
        m = ((1 << b) - 1)
        if ((addr.toUnsigned() & m) == 0):
            return check(addr, b)
        else:
            return check(addr, 0)
    try:
        wild = (32 - int(addr[1]))
    except:
        m = IPAddr(addr[1]).toUnsigned()
        b = 0
        while (m & (1 << 31)):
            b += 1
            m <<= 1
        if ((m & 2147483647) != 0):
            raise RuntimeError((('Netmask    ' + str(addr[1])) + '    is    not    CIDR-compatible'))
        wild = (32 - b)
        assert ((wild >= 0) and (wild <= 32))
        return check(IPAddr(addr[0]), wild)
    assert ((wild >= 0) and (wild <= 32))
    return check(IPAddr(addr[0]), wild)

What's a good function header?
assistant
#Here's a good function header.

def parse_cidr(addr, infer=True, allow_host=False):