docstr: ...Test HawkesExpKern setting of parameter of
  elastic_net_ratio
docstr_tok: ["...","Test","HawkesExpKern","setting","of","parameter","of","elastic_net_ratio"]
code: def test_HawkesExpKern_penalty_elastic_net_ratio(self):
      """...Test HawkesExpKern setting of parameter of
      elastic_net_ratio
      """
      ratio_1 = 0.6
      ratio_2 = 0.3
  
      for penalty in penalties:
          if penalty == "elasticnet":
              learner = HawkesExpKern(
                  self.decays,
                  penalty=penalty,
                  C=self.float_1,
                  elastic_net_ratio=ratio_1,
              )
              self.assertEqual(learner.C, self.float_1)
              self.assertEqual(learner.elastic_net_ratio, ratio_1)
              self.assertEqual(
                  learner._prox_obj.strength, 1.0 / self.float_1
              )
              self.assertEqual(learner._prox_obj.ratio, ratio_1)
  
              learner.elastic_net_ratio = ratio_2
              self.assertEqual(learner.C, self.float_1)
              self.assertEqual(learner.elastic_net_ratio, ratio_2)
              self.assertEqual(learner._prox_obj.ratio, ratio_2)
  
          else:
              learner = HawkesExpKern(self.decays, penalty=penalty)
              msg = (
                  '^Penalty "%s" has no elastic_net_ratio attribute$$'
                  % penalty
              )
              with self.assertWarnsRegex(RuntimeWarning, msg):
                  learner.elastic_net_ratio = ratio_1
  
imports: import unittest
  import numpy
  from tick.base.inference import InferenceTest
  from tick.hawkes import SimuHawkesExpKernels
  from tick.hawkes.inference import HawkesExpKern
  from tick.hawkes.model.model_hawkes_expkern_leastsq import ModelHawkesExpKernLeastSq
  from tick.hawkes.model.model_hawkes_expkern_loglik import ModelHawkesExpKernLogLik
  from tick.prox import ProxNuclear
  from tick.prox import ProxPositive, ProxL1, ProxL2Sq, ProxElasticNet
  from tick.solver import AGD, GD, BFGS, SGD, SVRG
label_desc: Use image node_id 11 for calling the Test obj's underlying member method code with example usage: obj.test_HawkesExpKern_penalty_elastic_net_ratio() without return types