docstr: The function returns a `numpy` array of `num_samples` where randomly chosen features,
  except those in anchor, are replaced by words sampled according to the language
  model's predictions.
  
  Parameters
  ----------
  anchor:
      Indices represent the positions of the words to be kept unchanged.
  num_samples:
      Number of perturbed sentences to be returned.
  
  Returns
  -------
  See :py:meth:`alibi.explainers.anchors.language_model_text_sampler.LanguageModelSampler.perturb_sentence`.
docstr_tok: ["The","function","returns","a","`","numpy","`","array","of","`","num_samples","`","where","randomly","chosen","features",",","except","those","in","anchor",",","are","replaced","by","words","sampled","according","to","the","language","model","'s","predictions",".","Parameters","--","--","--","--","--","anchor",":","Indices","represent","the","positions","of","the","words","to","be","kept","unchanged",".","num_samples",":","Number","of","perturbed","sentences","to","be","returned",".","Returns","--","--","--","-","See",":","py",":","meth",":","`","alibi.explainers.anchors.language_model_text_sampler.LanguageModelSampler.perturb_sentence","`","."]
code: def __call__(
      self, anchor: tuple, num_samples: int
  ) -> Tuple[np.ndarray, np.ndarray]:
      """
      The function returns a `numpy` array of `num_samples` where randomly chosen features,
      except those in anchor, are replaced by words sampled according to the language
      model's predictions.
  
      Parameters
      ----------
      anchor:
          Indices represent the positions of the words to be kept unchanged.
      num_samples:
          Number of perturbed sentences to be returned.
  
      Returns
      -------
      See :py:meth:`alibi.explainers.anchors.language_model_text_sampler.LanguageModelSampler.perturb_sentence`.
      """
      assert self.perturb_opts, "Perturbation options are not set."
      return self.perturb_sentence(
          anchor, num_samples, **self.perturb_opts
      )
  
imports: import string
  from functools import partial
  from typing import Dict, List, Optional, Tuple
  import numpy
  import tensorflow
  from alibi.utils.lang_model import LanguageModel
  from alibi.explainers.anchors.text_samplers import AnchorTextSampler
label_desc: Use image node_id 4 for calling the LanguageModelSampler obj's underlying member method code with example usage: obj.__call__(anchor, num_samples) and returns: self