code: def test_tvl1_solver_raises_value_error_if_invalid_loss():
      with pytest.raises(ValueError, match="mse' or 'logistic"):
          tvl1_solver(
              np.array([[1]]),
              None,
              None,
              None,
              None,
              loss="invalidloss",
          )
  
imports: import numpy
  import pytest
  from nilearn.decoding._objective_functions import gradient_id, squared_loss
  from nilearn.decoding.space_net_solvers import _tvl1_objective, _tvl1_objective_from_gradient, tvl1_solver
label_desc: Use image node_id 3 for calling a global function with example usage: test_tvl1_solver_raises_value_error_if_invalid_loss() without return types