IP.random

You're seeing just the function random, go back to IP module for more information.
Link to this function

random(range_or_subnet, excludes \\ [])

View Source

picks a random ip address from a range or a subnet.

You may exclude individual ip addresses, ranges, or subnets to the excludes parameter and they won't be picked.

Note that subnets will pick the prefix and broadcast addresses, if you would like to exclude those, you must add them explicitly to the excludes parameter.

Warning: this algorithm is rather bad, so use only with blocks of less than about 1024.