def retry_once_with_later_random_values(testfunc: Callable) -> Callable:
    """Marks a test function for one retry with later random values.

    This decorator is intended for test functions which occasionally fail
    for specific random seeds from pytest-randomly.
    """

    @functools.wraps(testfunc)
    def wrapped_func(*args, **kwargs) -> Any:
        try:
            return testfunc(*args, **kwargs)
        except AssertionError:
            pass
        warnings.warn("Retrying in case we got a failing seed from pytest-randomly.")
        return testfunc(*args, **kwargs)

    return wrapped_func
Marks a test function for one retry with later random values.

    This decorator is intended for test functions which occasionally fail
    for specific random seeds from pytest-randomly.
    
cirq-core/cirq/testing/pytest_utils.py