class_docstr: Components that take parameters. This also provides an internal
  param map to store parameter values attached to the instance.
  
  .. versionadded:: 1.3.0
docstr: Copies param values from this instance to another instance for
  params shared by them.
  
  Parameters
  ----------
  to : :py:class:`Params`
      the target instance
  extra : dict, optional
      extra params to be copied
  
  Returns
  -------
  :py:class:`Params`
      the target instance with param values copied
docstr_tok: ["Copies","param","values","from","this","instance","to","another","instance","for","params","shared","by","them",".","Parameters","--","--","--","--","--","to",":",":","py",":","class",":","`","Params","`","the","target","instance","extra",":","dict",",","optional","extra","params","to","be","copied","Returns","--","--","--","-",":","py",":","class",":","`","Params","`","the","target","instance","with","param","values","copied"]
code: def _copyValues(self, to: P, extra: Optional["ParamMap"] = None) -> P:
      """
      Copies param values from this instance to another instance for
      params shared by them.
  
      Parameters
      ----------
      to : :py:class:`Params`
          the target instance
      extra : dict, optional
          extra params to be copied
  
      Returns
      -------
      :py:class:`Params`
          the target instance with param values copied
      """
      paramMap = self._paramMap.copy()
      if isinstance(extra, dict):
          for param, value in extra.items():
              if isinstance(param, Param):
                  paramMap[param] = value
              else:
                  raise TypeError(
                      "Expecting a valid instance of Param, but received: {}".format(
                          param
                      )
                  )
      elif extra is not None:
          raise TypeError(
              "Expecting a dict, but received an object of type {}.".format(
                  type(extra)
              )
          )
      for param in self.params:
          # copy default params
          if param in self._defaultParamMap and to.hasParam(param.name):
              to._defaultParamMap[
                  to.getParam(param.name)
              ] = self._defaultParamMap[param]
          # copy explicitly set params
          if param in paramMap and to.hasParam(param.name):
              to._set(**{param.name: paramMap[param]})
      return to
  
imports: import array
  from abc import ABCMeta
  import copy
  from typing import Any, Callable, Generic, List, Optional, overload, TypeVar, Union, TYPE_CHECKING
  import numpy
  from py4j.java_gateway import JavaObject
  from pyspark.ml.linalg import DenseVector, Vector, Matrix
  from pyspark.ml.util import Identifiable
label_desc: Use image node_id 24 for calling the Params obj's underlying member method code with example usage: obj._copyValues(to, extra) and returns: to