(
    base_url: Optional[str],
    endpoint: Optional[str],
)
return '/'.join((base_url.rstrip('/'), endpoint.lstrip('/')))
Joins ``endpoint`` to ``base_url``. If either are None, returns the
    other. If both are None, raises ValueError.

    >>> get_endpoint_url('https://example.com/', '/foo')
    'https://example.com/foo'

    >>> get_endpoint_url('https://example.com', 'foo')
    'https://example.com/foo'

    >>> get_endpoint_url('https://example.com/foo', None)
    'https://example.com/foo'
Joins ``endpoint`` to ``base_url``. If either are None, returns the
    other. If both are None, raises ValueError.
Joins endpoint to base_url . If either are None returns the other . If both are None raises ValueError .
def get_endpoint_url(
    base_url: Optional[str],
    endpoint: Optional[str],
) -> str:
    """
    Joins ``endpoint`` to ``base_url``. If either are None, returns the
    other. If both are None, raises ValueError.

    >>> get_endpoint_url('https://example.com/', '/foo')
    'https://example.com/foo'

    >>> get_endpoint_url('https://example.com', 'foo')
    'https://example.com/foo'

    >>> get_endpoint_url('https://example.com/foo', None)
    'https://example.com/foo'

    """
    if base_url is None and endpoint is None:
        raise ValueError('No URLs given')
    if base_url is None:
        return endpoint
    if endpoint is None:
        return base_url
    return '/'.join((base_url.rstrip('/'), endpoint.lstrip('/')))
def get_endpoint_url ( base_url : Optional [ str ] , endpoint : Optional [ str ] , ) -> str : if base_url is None and endpoint is None : raise ValueError ( 'No URLs given' ) if base_url is None : return endpoint if endpoint is None : return base_url return '/' . join ( ( base_url . rstrip ( '/' ) , endpoint . lstrip ( '/' ) ) )