def search(req: SearchRequest) -> SearchResponse:
    errors, search_input = _extract_search_input(req)
    if errors:
        return SearchResponse.error(errors)

    country = search_input.country_of_incorporation
    if country not in SUPPORTED_COUNTRIES:
        return SearchResponse.error([Error.unsupported_country()])

    if req.demo_result is not None:
        return _run_demo_search(search_input, req.demo_result, req.commercial_relationship)

    return SearchResponse.error([Error({
        'type': ErrorType.PROVIDER_MESSAGE,
        'message': 'Live searches are not supported',
    })])
def run_check(req: RunCheckRequest) -> RunCheckResponse:
    errors, check_input = _extract_check_input(req)
    if errors:
        return RunCheckResponse.error(errors)

    country = check_input.country_of_incorporation
    if country not in SUPPORTED_COUNTRIES:
        return RunCheckResponse.error([Error.unsupported_country()])

    if req.demo_result is not None:
        return _run_demo_check(check_input, req.demo_result, req.commercial_relationship)

    return RunCheckResponse.error([Error({
        'type': ErrorType.PROVIDER_MESSAGE,
        'message': 'Live checks are not supported',
    })])
def run_check(req: RunCheckRequest) -> RunCheckResponse:
    errors, _external_ref = _extract_input(req)
    if errors:
        return RunCheckResponse.error(errors)

    country = req.check_input.get_current_address().country
    if country not in SUPPORTED_COUNTRIES:
        return RunCheckResponse.error([Error.unsupported_country()])

    if req.demo_result is not None:
        return _run_demo_check(req.id, req.check_input, req.demo_result)

    return RunCheckResponse.error([
        Error({
            'type': ErrorType.PROVIDER_MESSAGE,
            'message': 'Live checks are not supported',
        })
    ])
def run_check(req: RunCheckRequest) -> RunCheckResponse:
    errors, check_input = _extract_input(req)
    if errors:
        return RunCheckResponse.error(DEMO_PROVIDER_ID, errors)

    country = check_input.get_current_address().country
    if country not in SUPPORTED_COUNTRIES:
        return RunCheckResponse.error(DEMO_PROVIDER_ID, [Error.unsupported_country()])

    # Download the images even though we won't do anything with them
    doc_images = {}
    for doc_image_id in check_input.get_document_image_ids():
        content = _download_image(doc_image_id)
        assert len(content) > 0
        doc_images[doc_image_id] = content

    if req.demo_result is not None:
        return _run_demo_check(req.id, check_input, req.demo_result)

    return RunCheckResponse.error(DEMO_PROVIDER_ID, [Error({
        'type': ErrorType.PROVIDER_MESSAGE,
        'message': 'Live checks are not supported',
    })])