docstr: ...Test LogisticRegression setting of parameter of C
          
docstr_tok: ["...","Test","LogisticRegression","setting","of","parameter","of","C"]
code: def test_LogisticRegression_penalty_C(self):
      """...Test LogisticRegression setting of parameter of C"""
      for penalty in penalties:
          if penalty != "none":
              if penalty == "binarsity":
                  learner = LogisticRegression(
                      penalty=penalty,
                      C=self.float_1,
                      blocks_start=[0],
                      blocks_length=[1],
                  )
              else:
                  learner = LogisticRegression(
                      penalty=penalty, C=self.float_1
                  )
              self.assertEqual(learner.C, self.float_1)
              self.assertEqual(
                  learner._prox_obj.strength, 1.0 / self.float_1
              )
              learner.C = self.float_2
              self.assertEqual(learner.C, self.float_2)
              self.assertEqual(
                  learner._prox_obj.strength, 1.0 / self.float_2
              )
              msg = "^``C`` must be positive, got -1$"
              with self.assertRaisesRegex(ValueError, msg):
                  if penalty == "binarsity":
                      LogisticRegression(
                          penalty=penalty,
                          C=-1,
                          blocks_start=[0],
                          blocks_length=[1],
                      )
                  else:
                      LogisticRegression(penalty=penalty, C=-1)
          else:
              msg = '^You cannot set C for penalty "%s"$' % penalty
              with self.assertWarnsRegex(RuntimeWarning, msg):
                  if penalty == "binarsity":
                      LogisticRegression(
                          penalty=penalty,
                          C=self.float_1,
                          blocks_start=[0],
                          blocks_length=[1],
                      )
                  else:
                      LogisticRegression(
                          penalty=penalty, C=self.float_1
                      )
  
              if penalty == "binarsity":
                  learner = LogisticRegression(
                      penalty=penalty,
                      blocks_start=[0],
                      blocks_length=[1],
                  )
              else:
                  learner = LogisticRegression(penalty=penalty)
              with self.assertWarnsRegex(RuntimeWarning, msg):
                  learner.C = self.float_1
  
          msg = "^``C`` must be positive, got -2$"
          with self.assertRaisesRegex(ValueError, msg):
              learner.C = -2
  
imports: import itertools
  import unittest
  import numpy
  from sklearn.metrics import roc_auc_score
  from tick.base.inference import InferenceTest
  from tick.linear_model import SimuLogReg, LogisticRegression
  from tick.simulation import weights_sparse_gauss
  from tick.preprocessing.features_binarizer import FeaturesBinarizer
  from tick.prox import ProxZero, ProxL1, ProxL2Sq, ProxElasticNet, ProxTV, ProxBinarsity
label_desc: Use image node_id 8 for calling the Test obj's underlying member method code with example usage: obj.test_LogisticRegression_penalty_C() without return types