docstr: ...Test error and warnings raised by LogLearner constructor
          
docstr_tok: ["...","Test","error","and","warnings","raised","by","LogLearner","constructor"]
code: def test_safe_array_cast(self):
      """...Test error and warnings raised by LogLearner constructor"""
      msg = (
          "^Copying array of size \(5, 5\) to convert it in the "
          "right format$"
      )
      with self.assertWarnsRegex(RuntimeWarning, msg):
          RobustLinearRegression._safe_array(self.X.astype(int))
  
      msg = (
          "^Copying array of size \(3, 5\) to create a "
          "C-contiguous version of it$"
      )
      with self.assertWarnsRegex(RuntimeWarning, msg):
          RobustLinearRegression._safe_array(self.X[::2])
  
      np.testing.assert_array_equal(
          self.X, RobustLinearRegression._safe_array(self.X)
      )
  
imports: import itertools
  import unittest
  import numpy
  from tick.base.inference import InferenceTest
  from tick.robust import RobustLinearRegression
  from tick.simulation import weights_sparse_gauss, features_normal_cov_toeplitz
  from tick.metrics import support_fdp, support_recall
label_desc: Use image node_id 15 for calling the Test obj's underlying member method code with example usage: obj.test_safe_array_cast() without return types