(path, url)
return path.startswith(url)
>>> path_starts_with_url('/a/test/reports/saved/', 'https://www.commcarehq.org/a/test/reports/')
    True
    >>> path_starts_with_url('/a/test/reports/saved/', '/a/test/reports/')
    True
    >>> path_starts_with_url('/a/test/reports/', '/a/test/reports/saved/')
    False
>>> path_starts_with_url('/a/test/reports/saved/', 'https://www.commcarehq.org/a/test/reports/')
    True
    >>> path_starts_with_url('/a/test/reports/saved/', '/a/test/reports/')
    True
    >>> path_starts_with_url('/a/test/reports/', '/a/test/reports/saved/')
    False
>>> path_starts_with_url ( / a / test / reports / saved / https : // www . commcarehq . org / a / test / reports / ) True >>> path_starts_with_url ( / a / test / reports / saved / / a / test / reports / ) True >>> path_starts_with_url ( / a / test / reports / / a / test / reports / saved / ) False
def path_starts_with_url(path, url):
    """
    >>> path_starts_with_url('/a/test/reports/saved/', 'https://www.commcarehq.org/a/test/reports/')
    True
    >>> path_starts_with_url('/a/test/reports/saved/', '/a/test/reports/')
    True
    >>> path_starts_with_url('/a/test/reports/', '/a/test/reports/saved/')
    False
    """
    url = six.moves.urllib.parse.urlparse(url).path
    return path.startswith(url)
def path_starts_with_url ( path , url ) : url = six . moves . urllib . parse . urlparse ( url ) . path return path . startswith ( url )