code: def test_bwcew_loss(
      preds: torch.Tensor,
      target: torch.Tensor,
      confidence_penalty: float,
      positive_class_weight: Optional[float],
      robust_lambda: int,
      output: torch.Tensor,
  ):
      loss = loss_modules.BWCEWLoss(
          BWCEWLossConfig(
              positive_class_weight=positive_class_weight,
              robust_lambda=robust_lambda,
              confidence_penalty=confidence_penalty,
          )
      )
      assert torch.isclose(loss(preds, target), output)
  
imports: import contextlib
  from typing import Optional, Type, Union
  import pytest
  import torch
  from marshmallow import ValidationError
  from ludwig.features.category_feature import CategoryOutputFeature
  from ludwig.features.set_feature import SetOutputFeature
  from ludwig.features.text_feature import TextOutputFeature
  from ludwig.modules import loss_modules
  from ludwig.schema.features.loss.loss import BWCEWLossConfig, CORNLossConfig, HuberLossConfig, MAELossConfig, MAPELossConfig, MSELossConfig, RMSELossConfig, RMSPELossConfig, SigmoidCrossEntropyLossConfig, SoftmaxCrossEntropyLossConfig
  from ludwig.schema.model_config import ModelConfig
  from tests.integration_tests.utils import category_feature, set_feature, text_feature
label_desc: Use image node_id 8 for calling a global function with example usage: test_bwcew_loss(preds, target, confidence_penalty, positive_class_weight, robust_lambda, output) without return types