Add local network detection to the `requires_network` decorator.