<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_random_service( service_registry: ServiceRegistry, block_identifier: BlockSpecification, ) -> Tuple[Optional[str], Optional[str]]: """Selects a random PFS from service_registry. Returns a tuple of the chosen services url and eth address. If there are no PFS in the given registry, it returns (None, None). """

    count = service_registry.service_count(block_identifier=block_identifier)
    if count == 0:
        return None, None
    index = random.SystemRandom().randint(0, count - 1)
    address = service_registry.get_service_address(
        block_identifier=block_identifier,
        index=index,
    )
    # We are using the same blockhash for both blockchain queries so the address
    # should exist for this query. Additionally at the moment there is no way for
    # services to be removed from the registry.
    assert address, 'address should exist for this index'
    url = service_registry.get_service_url(
        block_identifier=block_identifier,
        service_hex_address=address,
    )
    return url, address