def _validate_authority_uri_abs_path(host, path):
        """Ensure that path in URL with authority starts with a leading slash.

        Raise ValueError if not.
        """
        if len(host) > 0 and len(path) > 0 and not path.startswith("/"):
            raise ValueError(
                "Path in a URL with authority should start with a slash ('/') if set"
            )
Ensure that path in URL with authority starts with a leading slash.

        Raise ValueError if not.
        
lib/yarl/_url.py