src/transformers/testing_utils.py
def require_optuna(test_case):
    """
    Decorator marking a test that requires optuna.

    These tests are skipped when optuna isn't installed.

    """
    if not is_optuna_available():
        return unittest.skip("test requires optuna")(test_case)
    else:
        return test_case

    Decorator marking a test that requires optuna.

    These tests are skipped when optuna isn't installed.

    
Decorator marking a test that requires optuna.
These tests are skipped when optuna isn't installed.
Decorator marking a test that requires optuna . These tests are skipped when optuna isn ' t installed .
def require_optuna(test_case):
    if not is_optuna_available():
        return unittest.skip("test requires optuna")(test_case)
    else:
        return test_case
def require_optuna ( test_case ) : if not is_optuna_available ( ) : return unittest . skip ( "test requires optuna" ) ( test_case ) else : return test_case
Decorator marking a test that requires optuna.
Decorator marking a test that requires optuna .
"""
    Decorator marking a test that requires optuna.

    These tests are skipped when optuna isn't installed.

    """
test_case