class_docstr: Union of MaskingText samplers, with weights.
  :meth:`sample_near` or :meth:`sample_near_with_mask` generate
  a requested number of samples using all samplers; a probability of
  using a sampler is proportional to its weight.
  
  All samplers must use the same token_pattern in order for
  :meth:`sample_near_with_mask` to work.
  
  Create it with a list of {param: value} dicts
  with :class:`MaskingTextSampler` paremeters.
class_docstr_tok: ["Union","of","MaskingText","samplers",",","with","weights",".",":","meth",":","`","sample_near","`","or",":","meth",":","`","sample_near_with_mask","`","generate","a","requested","number","of","samples","using","all","samplers",";","a","probability","of","using","a","sampler","is","proportional","to","its","weight",".","All","samplers","must","use","the","same","token_pattern","in","order","for",":","meth",":","`","sample_near_with_mask","`","to","work",".","Create","it","with","a","list","of","{","param",":","value","}","dicts","with",":","class",":","`","MaskingTextSampler","`","paremeters","."]
code: def sample_near(self, doc, n_samples=1):
      # type: (str, int) -> Tuple[List[str], np.ndarray]
      assert n_samples >= 1
      all_docs = []  # type: List[str]
      similarities = []
      for sampler, freq in self._sampler_n_samples(n_samples):
          docs, sims = sampler.sample_near(doc, n_samples=freq)
          all_docs.extend(docs)
          similarities.append(sims)
      return all_docs, np.hstack(similarities)
  
imports: from __future__ import absolute_import
  import abc
  from functools import partial
  from typing import List, Tuple, Any, Union, Dict, Optional
  import six
  import numpy
  from scipy.stats import itemfreq
  from sklearn.base import BaseEstimator, clone
  from sklearn.neighbors import KernelDensity
  from sklearn.metrics import pairwise_distances
  from sklearn.model_selection import GridSearchCV, KFold
  from sklearn.utils import check_random_state
  from eli5.utils import vstack
  from eli5.lime.utils import rbf
  from .textutils import generate_samples, DEFAULT_TOKEN_PATTERN, TokenizedText
label_desc: Use image node_id 3 for calling the MaskingTextSamplers obj's underlying member method code with example usage: obj.sample_near(doc, n_samples) and returns: all_docs,  np