code: def _filter_kwargs(names, dict_):
      
      return {k: v for k, v in dict_.items() if k in names and v is not None}
docs: Filter out kwargs from a dictionary.
  
      Parameters
      ----------
      names : set[str]
          The names to select from ``dict_``.
      dict_ : dict[str, any]
          The dictionary to select from.
  
      Returns
      -------
      kwargs : dict[str, any]
          ``dict_`` where the keys intersect with ``names`` and the values are
          not None.