environment/lib/python2.7/site-packages/IPython/frontend/html/notebook/notebookapp.py
def random_ports(port, n):
    """Generate a list of n random ports near the given port.

    The first 5 ports will be sequential, and the remaining n-5 will be
    randomly selected in the range [port-2*n, port+2*n].
    """
    for i in range(min(5, n)):
        yield port + i
    for i in range(n-5):
        yield port + random.randint(-2*n, 2*n)
def random_ports(port, n):
    for i in range(min(5, n)):
        yield port + i
    for i in range(n-5):
        yield port + random.randint(-2*n, 2*n)
def random_ports ( port , n ) : for i in range ( min ( 5 , n ) ) : yield port + i for i in range ( n - 5 ) : yield port + random . randint ( - 2 * n , 2 * n )
Generate a list of n random ports near the given port.

    The first 5 ports will be sequential, and the remaining n-5 will be
    randomly selected in the range [port-2*n, port+2*n].
Generate a list of n random ports near the given port .