human
I wrote the below code

    def _is_unreachable_err(err):
        return (getattr(err, 'errno', None) in (errno.ENETUNREACH, errno.EHOSTUNREACH))
    def _has_route():
        try:
            sock = socket.create_connection((TARPIT_HOST, 80), 0.0001)
            sock.close()
            return True
        except socket.timeout:
            return True
        except socket.error as e:
            if _is_unreachable_err(e):
                return False
            else:
                raise
    @functools.wraps(test)
    def wrapper(*args, **kwargs):
        global _requires_network_has_route
        if (_requires_network_has_route is None):
            _requires_network_has_route = _has_route()
        if _requires_network_has_route:
            return test(*args, **kwargs)
        else:
            msg = "Can't    run    {name}    because    the    network    is    unreachable".format(name=test.__name__)
            pytest.skip(msg)
    return wrapper

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

def requires_network(test):