<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def configure_pfs_or_exit( pfs_address: Optional[str], pfs_eth_address: Optional[str], routing_mode: RoutingMode, service_registry, ) -> Optional[PFSConfiguration]: """ Take in the given pfs_address argument, the service registry and find out a pfs address to use. If pfs_address is None then basic routing must have been requested. If pfs_address is provided we use that. If pfs_address is 'auto' then we randomly choose a PFS address from the registry Returns a NamedTuple containing url, eth_address and fee (per paths request) of the selected PFS, or None if we use basic routing instead of a PFS. """

    if routing_mode == RoutingMode.BASIC:
        msg = 'Not using path finding services, falling back to basic routing.'
        log.info(msg)
        click.secho(msg)
        return None

    msg = "With PFS routing mode we shouldn't get to configure pfs with pfs_address being None"
    assert pfs_address, msg
    if pfs_address == 'auto':
        assert service_registry, 'Should not get here without a service registry'
        block_hash = service_registry.client.get_confirmed_blockhash()
        pfs_address, pfs_eth_address = get_random_service(
            service_registry=service_registry,
            block_identifier=block_hash,
        )
        if pfs_address is None:
            click.secho(
                "The service registry has no registered path finding service "
                "and we don't use basic routing.",
            )
            sys.exit(1)

    assert pfs_eth_address, "At this point pfs_eth_address can't be none"
    pathfinding_service_info = get_pfs_info(pfs_address)
    if not pathfinding_service_info:
        click.secho(
            f'There is an error with the pathfinding service with address '
            f'{pfs_address}. Raiden will shut down.',
        )
        sys.exit(1)
    else:
        msg = configure_pfs_message(
            info=pathfinding_service_info,
            url=pfs_address,
            eth_address=pfs_eth_address,
        )
        click.secho(msg)
        log.info('Using PFS', pfs_info=pathfinding_service_info)

    return PFSConfiguration(
        url=pfs_address,
        eth_address=pfs_eth_address,
        fee=pathfinding_service_info.get('price_info', 0),
    )