def get_presigned_s3_url(location: S3Location, auth: Optional[S3Auth] = None):
    """Returns the s3 url of a request to get an S3 object

    Args:
        location: Bucket and key of model file to be downloaded
        auth: AWS IAM access keys to a user with access to the model to be downloaded

    Returns:
        The presigned s3 URL

    TODO: add link to proper usage in error messages
    """
    s3_client = boto3.client('s3', **(auth.dict() if auth is not None else {}))
    try:
        return s3_client.generate_presigned_url('get_object', Params=location.dict(exclude_unset=True))
    except NoCredentialsError:
        raise ModelDownloadError(
            "Error retrieving private model. AWS credentials were not accepted."
        )
Returns the s3 url of a request to get an S3 object

    Args:
        location: Bucket and key of model file to be downloaded
        auth: AWS IAM access keys to a user with access to the model to be downloaded

    Returns:
        The presigned s3 URL

    TODO: add link to proper usage in error messages
    
src/marqo/inference/model_download/download_model_from_s3.py