code: def test_generate_unfixed_nonlin_constraints(self):
      def nlc1(x):
          return 4 - x.sum(dim=-1)
  
      def nlc2(x):
          return x[..., 0] - 1
  
      # first test with one constraint
      (new_nlc1,) = _generate_unfixed_nonlin_constraints(
          constraints=[(nlc1, True)],
          fixed_features={1: 2.0},
          dimension=3,
      )
      self.assertAllClose(
          nlc1(torch.tensor([[4.0, 2.0, 2.0]], device=self.device)),
          new_nlc1[0](torch.tensor([[4.0, 2.0]], device=self.device)),
      )
      # test with several constraints
      constraints = [(nlc1, True), (nlc2, True)]
      new_constraints = _generate_unfixed_nonlin_constraints(
          constraints=constraints, fixed_features={1: 2.0}, dimension=3
      )
      for nlc, new_nlc in zip(constraints, new_constraints):
          self.assertAllClose(
              nlc[0](
                  torch.tensor([[4.0, 2.0, 2.0]], device=self.device)
              ),
              new_nlc[0](
                  torch.tensor([[4.0, 2.0]], device=self.device)
              ),
          )
      # test with several constraints and two fixes
      constraints = [(nlc1, True), (nlc2, True)]
      new_constraints = _generate_unfixed_nonlin_constraints(
          constraints=constraints,
          fixed_features={1: 2.0, 2: 1.0},
          dimension=3,
      )
      for nlc, new_nlc in zip(constraints, new_constraints):
          self.assertAllClose(
              nlc[0](
                  torch.tensor([[4.0, 2.0, 1.0]], device=self.device)
              ),
              new_nlc[0](torch.tensor([[4.0]], device=self.device)),
          )
  
imports: from itertools import product
  from typing import Callable
  import numpy
  import torch
  from botorch.exceptions.errors import CandidateGenerationError, UnsupportedError
  from botorch.optim.parameter_constraints import _arrayify, _generate_unfixed_lin_constraints, _generate_unfixed_nonlin_constraints, _make_linear_constraints, _make_nonlinear_constraints, eval_lin_constraint, lin_constraint_jac, make_scipy_bounds, make_scipy_linear_constraints, make_scipy_nonlinear_inequality_constraints, nonlinear_constraint_is_feasible
  from botorch.utils.testing import BotorchTestCase
  from scipy.optimize import Bounds
label_desc: Use image node_id 10 for calling the TestParameterConstraints obj's underlying member method code with example usage: obj.test_generate_unfixed_nonlin_constraints() and returns: unknown, unknown