code: def safe_sqr(X, copy=True):
      """Element wise squaring of array-likes and sparse matrices.
  
      Parameters
      ----------
      X : array like, matrix, sparse matrix
  
      copy : boolean, optional, default True
          Whether to create a copy of X and operate on it or to perform
          inplace computation (default behaviour).
  
      Returns
      -------
      X ** 2 : element wise square
      """
      X = check_array(
          X, accept_sparse=["csr", "csc", "coo"], ensure_2d=False
      )
      if issparse(X):
          if copy:
              X = X.copy()
          X.data **= 2
      else:
          if copy:
              X = X**2
          else:
              X **= 2
      return X
  
imports: from collections import Sequence
  import numpy
  from scipy.sparse import issparse
  import warnings
  from .murmurhash import murmurhash3_32
  from .validation import as_float_array, assert_all_finite, check_random_state, column_or_1d, check_array, check_consistent_length, check_X_y, indexable, check_symmetric
  from .deprecation import deprecated
  from .class_weight import compute_class_weight, compute_sample_weight
  from ..externals.joblib import cpu_count
  from ..exceptions import ConvergenceWarning
  from ..exceptions import DataConversionWarning
label_desc: Use image node_id 6 for calling a global function with example usage: safe_sqr(X, copy) and returns: X